chore: 编译依赖拆包manualChunks行为
This commit is contained in:
@@ -66,10 +66,27 @@ export default defineConfig(({ mode }) => {
|
||||
chunkFileNames: 'js/[name].[hash].js',
|
||||
// 用于输出静态资源的块
|
||||
assetFileNames: 'assets/[name].[hash].[ext]',
|
||||
manualChunks: id => {
|
||||
if (id.indexOf('node_modules') !== -1) {
|
||||
return 'vendor/index';
|
||||
}
|
||||
manualChunks: {
|
||||
vendorVue: ['vue', 'vue-router', 'pinia'],
|
||||
vendorVuePlugins: [
|
||||
'vue-i18n',
|
||||
'vue3-smooth-dnd',
|
||||
'grid-layout-plus',
|
||||
'@vueuse/core',
|
||||
],
|
||||
vendorAnt: ['ant-design-vue', '@ant-design/icons-vue'],
|
||||
vendorAntv: ['@antv/g6'],
|
||||
vendorEcharts: ['echarts'],
|
||||
vendorPDF: ['@tato30/vue-pdf'],
|
||||
vendorXterm: ['@xterm/xterm', '@xterm/addon-fit'],
|
||||
vendorCodemirror: [
|
||||
'codemirror',
|
||||
'@codemirror/lang-yaml',
|
||||
'@codemirror/lang-javascript',
|
||||
'@codemirror/merge',
|
||||
'@codemirror/theme-one-dark',
|
||||
],
|
||||
vendorUtils: ['crypto-js', 'nprogress', 'p-queue', 'dayjs', 'xlsx'],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user