diff --git a/.changeset/happy-monkeys-pump.md b/.changeset/happy-monkeys-pump.md new file mode 100644 index 000000000000..2124bdff8c1a --- /dev/null +++ b/.changeset/happy-monkeys-pump.md @@ -0,0 +1,9 @@ +--- +'@modern-js/plugin-router-v5': patch +'@modern-js/plugin-garfish': patch +'@modern-js/runtime': patch +--- + +fix: more runtime plugin add alias not work + +fix: 多个 runtime 插件添加 runtime 路径别名时不符合预期 diff --git a/packages/runtime/plugin-garfish/src/cli/index.ts b/packages/runtime/plugin-garfish/src/cli/index.ts index fae490ad1156..71c735e53ee0 100644 --- a/packages/runtime/plugin-garfish/src/cli/index.ts +++ b/packages/runtime/plugin-garfish/src/cli/index.ts @@ -137,9 +137,6 @@ export const garfishPlugin = (): CliPlugin< source: { alias: { [`@${metaName}/runtime/garfish`]: `@${metaName}/plugin-garfish/runtime`, - '@meta/runtime/browser': '@modern-js/runtime/browser', - '@meta/runtime/react': '@modern-js/runtime/react', - '@meta/runtime': '@modern-js/runtime', }, }, tools: { diff --git a/packages/runtime/plugin-router-v5/src/cli/index.ts b/packages/runtime/plugin-router-v5/src/cli/index.ts index 69e71593f49d..a4ca9a6f514c 100644 --- a/packages/runtime/plugin-router-v5/src/cli/index.ts +++ b/packages/runtime/plugin-router-v5/src/cli/index.ts @@ -54,8 +54,6 @@ export const routerPlugin = (): CliPlugin => ({ source: { alias: { [`@${metaName}/runtime/router-v5`]: routerExportsUtils.getPath(), - '@meta/runtime/context': '@modern-js/runtime/context', - '@meta/runtime': '@modern-js/runtime', }, }, }; diff --git a/packages/runtime/plugin-runtime/src/cli/index.ts b/packages/runtime/plugin-runtime/src/cli/index.ts index 8c8c55ce70e8..58b26f157e61 100644 --- a/packages/runtime/plugin-runtime/src/cli/index.ts +++ b/packages/runtime/plugin-runtime/src/cli/index.ts @@ -109,6 +109,10 @@ export const runtimePlugin = (params?: { * Compatible with the reference path of the old version of the plugin. */ [`@${metaName}/runtime/plugins`]: pluginsExportsUtils.getPath(), + '@meta/runtime/browser': '@modern-js/runtime/browser', + '@meta/runtime/react': '@modern-js/runtime/react', + '@meta/runtime/context': '@modern-js/runtime/context', + '@meta/runtime': '@modern-js/runtime', }, globalVars: { 'process.env.IS_REACT18': process.env.IS_REACT18,