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');
|
page.chunks?.unshift('common');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
miniCssExtractPluginOption: {
|
||||||
|
ignoreOrder: true,
|
||||||
|
},
|
||||||
postcss: {
|
postcss: {
|
||||||
pxtransform: { enable: true, config: {} },
|
pxtransform: { enable: true, config: {} },
|
||||||
cssModules: {
|
cssModules: {
|
||||||
|
|||||||
@@ -9,10 +9,17 @@ export default {
|
|||||||
drop_console: true,
|
drop_console: true,
|
||||||
drop_debugger: true,
|
drop_debugger: true,
|
||||||
pure_funcs: ['console.log', 'console.info', 'console.debug', 'console.warn'],
|
pure_funcs: ['console.log', 'console.info', 'console.debug', 'console.warn'],
|
||||||
|
passes: 2,
|
||||||
|
unsafe: true,
|
||||||
|
unsafe_comps: true,
|
||||||
|
unsafe_math: true,
|
||||||
},
|
},
|
||||||
format: {
|
format: {
|
||||||
comments: false,
|
comments: false,
|
||||||
},
|
},
|
||||||
|
mangle: {
|
||||||
|
toplevel: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
h5: {
|
h5: {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export default defineAppConfig({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: 'pages/pkg-doctor-core',
|
root: 'pages/pkg-doctor-core',
|
||||||
|
independent: true,
|
||||||
pages: [
|
pages: [
|
||||||
'index', 'patients/index', 'patients/detail/index',
|
'index', 'patients/index', 'patients/detail/index',
|
||||||
'consultation/index', 'consultation/detail/index',
|
'consultation/index', 'consultation/detail/index',
|
||||||
@@ -27,6 +28,7 @@ export default defineAppConfig({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: 'pages/pkg-doctor-clinical',
|
root: 'pages/pkg-doctor-clinical',
|
||||||
|
independent: true,
|
||||||
pages: [
|
pages: [
|
||||||
'dialysis/index', 'dialysis/detail/index', 'dialysis/create/index',
|
'dialysis/index', 'dialysis/detail/index', 'dialysis/create/index',
|
||||||
'prescription/index', 'prescription/detail/index', 'prescription/create/index',
|
'prescription/index', 'prescription/detail/index', 'prescription/create/index',
|
||||||
|
|||||||
Reference in New Issue
Block a user