|
@@ -41,7 +41,17 @@ export default defineConfig({
|
|
|
output: { // 静态资源分类打包
|
|
output: { // 静态资源分类打包
|
|
|
chunkFileNames: 'js/[name]-[hash].js',
|
|
chunkFileNames: 'js/[name]-[hash].js',
|
|
|
entryFileNames: 'js/[name]-[hash].js',
|
|
entryFileNames: 'js/[name]-[hash].js',
|
|
|
- assetFileNames: 'assets/[name]-[hash].[ext]'
|
|
|
|
|
|
|
+ assetFileNames: 'assets/[name]-[hash].[ext]',
|
|
|
|
|
+ // 拆分node_modules包
|
|
|
|
|
+ manualChunks: (id: any) => {
|
|
|
|
|
+ if (id.includes("node_modules")) {
|
|
|
|
|
+ return id
|
|
|
|
|
+ .toString()
|
|
|
|
|
+ .split("node_modules/")[1]
|
|
|
|
|
+ .split("/")[0]
|
|
|
|
|
+ .toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
terserOptions: { // 去掉打印
|
|
terserOptions: { // 去掉打印
|