refactor: unlock dev flow, dedupe EcommercePage, extract shell UI components
This commit is contained in:
+10
-2
@@ -42,8 +42,16 @@ export default defineConfig(({ command }) => {
|
||||
if (id.includes("node_modules/react") || id.includes("node_modules/react-dom") || id.includes("node_modules/scheduler")) {
|
||||
return "vendor-react";
|
||||
}
|
||||
if (id.includes("node_modules/@ant-design") || id.includes("node_modules/antd") || id.includes("node_modules/rc-")) {
|
||||
return "vendor-antd";
|
||||
// 项目未安装 antd,只用了 @ant-design/icons + @phosphor-icons/react。
|
||||
// 把图标库及其依赖(icons-svg / colors / fast-color / rc-util)单独成块,
|
||||
// 避免它们被打进 EcommercePage 业务 chunk,方便浏览器长缓存。
|
||||
if (
|
||||
id.includes("node_modules/@ant-design") ||
|
||||
id.includes("node_modules/@phosphor-icons") ||
|
||||
id.includes("node_modules/rc-util") ||
|
||||
id.includes("node_modules/rc-")
|
||||
) {
|
||||
return "vendor-icons";
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user