reafctor: 分包

This commit is contained in:
mozzie 2023-03-21 13:50:20 +08:00
parent f6dfae4585
commit 46c4be225a
2 changed files with 8 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -28,6 +28,13 @@ export default defineConfig({
build: { build: {
rollupOptions: { rollupOptions: {
output: { output: {
manualChunks: {
// key不重要会被 chunkFileNames [hash].js重命名
"r-vendor": ["react"],
"rd-vendor": ["react-dom"],
"rdd-vendor": ["react-router-dom"],
"dp-vendor": ["dplayer"],
},
// 入口文件名 // 入口文件名
entryFileNames: "assets/[hash].js", entryFileNames: "assets/[hash].js",
// 块文件名 // 块文件名