From 28a648e5ce929614502b29876ec8d4c52eeec9ca Mon Sep 17 00:00:00 2001 From: Logan Volkers Date: Fri, 20 Jul 2018 14:59:53 -0700 Subject: [PATCH] Allow plugins to be defined as functions and imported instead of globally namespaced --- src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.js b/src/index.js index 1d4a22d02..20b003f2a 100644 --- a/src/index.js +++ b/src/index.js @@ -58,6 +58,8 @@ module.exports = (() => { if (plugin) { plugin(editor, config.pluginsOpts[pluginId] || {}); + } else if (typeof pluginId === 'function') { + pluginId(editor, config.pluginsOpts[pluginId] || {}); } else { console.warn(`Plugin ${pluginId} not found`); }