Catch if plugins aren't found globally (#4452)
This commit is contained in:
parent
06fb437625
commit
b0a98cc973
|
|
@ -81,12 +81,18 @@ export async function loadPlugins(pluginNames, options, context, queue) {
|
|||
plugins.push(p);
|
||||
} catch (error) {
|
||||
// try global
|
||||
let { default: plugin } = await importGlobalSilent(name);
|
||||
if (plugin) {
|
||||
let p = new plugin(options, context, queue);
|
||||
plugins.push(p);
|
||||
} else {
|
||||
console.error("Couldn't load plugin %s: %s", name, error_);
|
||||
try {
|
||||
let { default: plugin } = await importGlobalSilent(name);
|
||||
if (plugin) {
|
||||
let p = new plugin(options, context, queue);
|
||||
plugins.push(p);
|
||||
} else {
|
||||
console.error("Couldn't load plugin %s: %s", name, error_);
|
||||
// if it fails here, let it fail hard
|
||||
throw error;
|
||||
}
|
||||
} catch {
|
||||
console.error("Couldn't find/load plugin %s", name);
|
||||
// if it fails here, let it fail hard
|
||||
throw error;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue