diff --git a/packages/core/client/src/application/utils/remotePlugins.ts b/packages/core/client/src/application/utils/remotePlugins.ts index b45011b1a4..221e168445 100644 --- a/packages/core/client/src/application/utils/remotePlugins.ts +++ b/packages/core/client/src/application/utils/remotePlugins.ts @@ -4,8 +4,8 @@ import type { RequireJS } from './requirejs'; import type { DevDynamicImport } from '../Application'; export function defineDevPlugins(plugins: Record) { - Object.entries(plugins).forEach(([name, plugin]) => { - window.define(name, () => plugin); + Object.entries(plugins).forEach(([packageName, plugin]) => { + window.define(`${packageName}/client`, () => plugin); }); } @@ -77,7 +77,6 @@ interface GetPluginsOption { export async function getPlugins(options: GetPluginsOption): Promise> { const { requirejs, pluginData, devDynamicImport } = options; - if (pluginData.length === 0) return []; if (process.env.NODE_ENV === 'development' && !process.env.USE_REMOTE_PLUGIN) { @@ -89,15 +88,13 @@ export async function getPlugins(options: GetPluginsOption): Promise !resolveDevPlugins[item.name]); + const remotePlugins = pluginData.filter((item) => !resolveDevPlugins[item.packageName]); if (remotePlugins.length === 0) { return res;