Skip to content

Commit

Permalink
fix(qiankun): 线上环境默认启用 shouldNotAddLibraryChunkName (#11690)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos authored Sep 26, 2023
1 parent 33abef0 commit bf3fd57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/plugins/src/qiankun/slave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ export interface IRuntimeConfig {
assert(api.pkg.name, 'You should have name in package.json.');
// 默认不修改 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) } = (api.config.qiankun || {}).slave!;
config.output
.libraryTarget('umd')
.library(
Expand Down

0 comments on commit bf3fd57

Please sign in to comment.