Skip to content

Commit a0ba632

Browse files
committed
build: remotes
1 parent d179bb3 commit a0ba632

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

webpack/webpack.common.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,10 @@ if (isMfeEnabled) {
384384
const mfeName = toMfeName(paths.projectName)
385385

386386
// 使用动态配置生成 remotes
387-
const remotes = isMfeHost ? generateRemotesConfig(isDev) : {}
388-
387+
// 注意:即使当前构建目标是 remote,也可能会编译到 Host 的路由/页面文件。
388+
// 为避免出现 "Can't resolve 'projectA/App'" 这类编译错误,这里统一注册 remotes。
389+
const remotes = generateRemotesConfig(isDev)
390+
389391
// 输出配置信息(仅在开发环境)
390392
if (isDev && isMfeHost) {
391393
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)