chore: refactor for better debugging
This commit is contained in:
parent
1f71fb152c
commit
01d0f4a663
|
@ -53,13 +53,15 @@ export default function loadPlugin<T>(config: Config, pluginConfigs: any = {}, p
|
||||||
return Object.keys(pluginConfigs).map((pluginId: string) => {
|
return Object.keys(pluginConfigs).map((pluginId: string) => {
|
||||||
let plugin;
|
let plugin;
|
||||||
|
|
||||||
|
const localPlugin = Path.resolve(__dirname + '/../plugins', pluginId);
|
||||||
// try local plugins first
|
// try local plugins first
|
||||||
plugin = tryLoad(Path.resolve(__dirname + '/../plugins', pluginId));
|
plugin = tryLoad(localPlugin);
|
||||||
|
|
||||||
// try the external plugin directory
|
// try the external plugin directory
|
||||||
if (plugin === null && config.plugins) {
|
if (plugin === null && config.plugins) {
|
||||||
const pluginDir = config.plugins;
|
const pluginDir = config.plugins;
|
||||||
plugin = tryLoad(Path.resolve(pluginDir, pluginId));
|
const externalFilePlugin = Path.resolve(pluginDir, pluginId);
|
||||||
|
plugin = tryLoad(externalFilePlugin);
|
||||||
|
|
||||||
// npm package
|
// npm package
|
||||||
if (plugin === null && pluginId.match(/^[^\.\/]/)) {
|
if (plugin === null && pluginId.match(/^[^\.\/]/)) {
|
||||||
|
|
Loading…
Reference in New Issue