From a805fa9562777e297119300b9ce4a02de999c0a0 Mon Sep 17 00:00:00 2001 From: ClarkXia Date: Mon, 6 May 2024 19:25:42 +0800 Subject: [PATCH] fix: minify config of swc (#6871) --- .changeset/tricky-cheetahs-mate.md | 5 +++++ packages/webpack-config/src/index.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/tricky-cheetahs-mate.md diff --git a/.changeset/tricky-cheetahs-mate.md b/.changeset/tricky-cheetahs-mate.md new file mode 100644 index 0000000000..0071da5fbd --- /dev/null +++ b/.changeset/tricky-cheetahs-mate.md @@ -0,0 +1,5 @@ +--- +'@ice/webpack-config': patch +--- + +fix: minify config of swc diff --git a/packages/webpack-config/src/index.ts b/packages/webpack-config/src/index.ts index dd187bda1b..3f0ab39271 100644 --- a/packages/webpack-config/src/index.ts +++ b/packages/webpack-config/src/index.ts @@ -139,7 +139,8 @@ export function getWebpackConfig(options: GetWebpackConfigOptions): Configuratio inline: 2, passes: 4, }, - mangle: { + // If JSMinifier is swc remove mangle config because it will cause minification error. + mangle: minify === JSMinifier.swc ? {} : { safari10: true, }, format: {