From 2c037171d70987bf23adf5dc517fbb9e164e76a4 Mon Sep 17 00:00:00 2001 From: Kuitos Date: Tue, 26 Sep 2023 13:00:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(qiankun):=20=E7=BA=BF=E4=B8=8A=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E9=BB=98=E8=AE=A4=E5=90=AF=E7=94=A8=20shouldNotAddLib?= =?UTF-8?q?raryChunkName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/plugins/src/qiankun/slave.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/plugins/src/qiankun/slave.ts b/packages/plugins/src/qiankun/slave.ts index e03a7937e199..a9dea5ff1b8d 100644 --- a/packages/plugins/src/qiankun/slave.ts +++ b/packages/plugins/src/qiankun/slave.ts @@ -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(