Skip to content

Commit

Permalink
fix(qiankun): 线上环境忽略 mfsu 配置
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos committed Oct 9, 2023
1 parent 8eb559a commit 803dc1b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/plugin-qiankun/src/slave/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ export default function (api: IApi) {

// 默认不修改 library chunk 的 name,从而确保可以通过 window[appName] 访问到导出
// mfsu 关闭的时候才可以修改,否则可能导致配合 mfsu 时,子应用的 umd chunk 无法被正确加载
const { shouldNotAddLibraryChunkName = !Boolean(api.config.mfsu) } = (api.config.qiankun || {})
.slave!;
// mfsu 线上不会开启,所以这里只需要判断本地是否开启即可
const {
shouldNotAddLibraryChunkName = api.env === 'production' ||
!Boolean(api.config.mfsu),

Check warning on line 109 in packages/plugin-qiankun/src/slave/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/plugin-qiankun/src/slave/index.ts#L109

Added line #L109 was not covered by tests
} = (api.config.qiankun || {}).slave!;

config.output
.libraryTarget('umd')
Expand Down

0 comments on commit 803dc1b

Please sign in to comment.