perf(mp): E3-3 构建优化 — 独立分包 + Terser 压缩增强
- 医生端分包(pkg-doctor-core/pkg-doctor-clinical)设 independent:true 减少主包体积,独立加载不依赖主包 - prod terser 添加 passes:2 + unsafe 压缩 + toplevel mangle 提升代码压缩率 - base config 添加 miniCssExtractPluginOption ignoreOrder 消除 CSS 顺序警告
This commit is contained in:
@@ -48,6 +48,9 @@ export default defineConfig(async (merge) => {
|
||||
page.chunks?.unshift('common');
|
||||
});
|
||||
},
|
||||
miniCssExtractPluginOption: {
|
||||
ignoreOrder: true,
|
||||
},
|
||||
postcss: {
|
||||
pxtransform: { enable: true, config: {} },
|
||||
cssModules: {
|
||||
|
||||
@@ -9,10 +9,17 @@ export default {
|
||||
drop_console: true,
|
||||
drop_debugger: true,
|
||||
pure_funcs: ['console.log', 'console.info', 'console.debug', 'console.warn'],
|
||||
passes: 2,
|
||||
unsafe: true,
|
||||
unsafe_comps: true,
|
||||
unsafe_math: true,
|
||||
},
|
||||
format: {
|
||||
comments: false,
|
||||
},
|
||||
mangle: {
|
||||
toplevel: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
h5: {
|
||||
|
||||
Reference in New Issue
Block a user