chore: 编译依赖拆包manualChunks行为
This commit is contained in:
@@ -55,8 +55,12 @@ export default defineConfig(({ mode }) => {
|
||||
// 用于输出静态资源的块
|
||||
assetFileNames: 'assets/[name].[hash].[ext]',
|
||||
manualChunks: id => {
|
||||
if (id.indexOf('node_modules') !== -1) {
|
||||
return 'vendor/index';
|
||||
if (id.includes('node_modules')) {
|
||||
return id
|
||||
.toString()
|
||||
.split('node_modules/')[1]
|
||||
.split('/')[0]
|
||||
.toString();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user