添加分割打包

This commit is contained in:
icssoa 2022-05-19 16:17:56 +08:00
parent 2c4d12f3ce
commit c63d374565
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "front-next", "name": "front-next",
"version": "5.2.0", "version": "5.2.1",
"scripts": { "scripts": {
"dev": "vite --host", "dev": "vite --host",
"build": "vite build", "build": "vite build",

View File

@ -53,7 +53,16 @@ export default (): UserConfig => {
}, },
build: { build: {
sourcemap: false, sourcemap: false,
polyfillDynamicImport: false // 必须为false polyfillDynamicImport: false, // 必须为false
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes("node_modules")) {
return id.toString().split("node_modules/")[1].split("/")[0].toString();
}
}
}
}
} }
}; };
}; };