- 医生端分包(pkg-doctor-core/pkg-doctor-clinical)设 independent:true 减少主包体积,独立加载不依赖主包 - prod terser 添加 passes:2 + unsafe 压缩 + toplevel mangle 提升代码压缩率 - base config 添加 miniCssExtractPluginOption ignoreOrder 消除 CSS 顺序警告
31 lines
669 B
TypeScript
31 lines
669 B
TypeScript
import type { UserConfigExport } from '@tarojs/cli';
|
|
|
|
export default {
|
|
logger: { quiet: true },
|
|
mini: {
|
|
miniCssExtractPluginOption: { ignoreOrder: true },
|
|
terserOption: {
|
|
compress: {
|
|
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: {
|
|
miniCssExtractPluginOption: {
|
|
ignoreOrder: true,
|
|
},
|
|
},
|
|
} satisfies UserConfigExport;
|