From 201fb8b62b9285739cf533b5341e0a980b64eab2 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Wed, 5 Mar 2025 17:55:58 +0100 Subject: [PATCH] Fix loading plugin help (#4463) --- lib/cli/pluginOptions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cli/pluginOptions.js b/lib/cli/pluginOptions.js index a05e7e097..72dbd0f60 100644 --- a/lib/cli/pluginOptions.js +++ b/lib/cli/pluginOptions.js @@ -11,14 +11,14 @@ export async function registerPluginOptions(yargsInstance, plugins) { for (const pluginName of plugins) { try { // Dynamically import the plugin - const plugin = await importGlobalSilent(pluginName); + let { default: plugin } = await importGlobalSilent(pluginName); // If the plugin exports a function to get CLI options, merge them if (plugin && typeof plugin.getCliOptions === 'function') { const options = plugin.getCliOptions(); yargsInstance.options(options); } else { try { - const plugin = await import(pluginName); + const { default: plugin } = await import(pluginName); if (plugin && typeof plugin.getCliOptions === 'function') { const options = plugin.getCliOptions(); yargsInstance.options(options);