2023-05-24 11:08:08 +08:00
|
|
|
|
import configCompressPlugin from './plugin/compress';
|
2023-10-17 10:35:21 +08:00
|
|
|
|
import configVisualizerPlugin from './plugin/visualizer';
|
|
|
|
|
import baseConfig from './vite.config.base';
|
2024-07-05 16:00:02 +08:00
|
|
|
|
import legacy from '@vitejs/plugin-legacy';
|
2023-10-17 10:35:21 +08:00
|
|
|
|
import { mergeConfig } from 'vite';
|
2023-05-24 11:08:08 +08:00
|
|
|
|
|
|
|
|
|
export default mergeConfig(
|
|
|
|
|
{
|
|
|
|
|
mode: 'production',
|
2024-07-05 16:00:02 +08:00
|
|
|
|
plugins: [
|
|
|
|
|
configCompressPlugin('gzip'),
|
|
|
|
|
configVisualizerPlugin(),
|
|
|
|
|
// 兼容性配置,配合package.json中的browserslist使用
|
|
|
|
|
legacy({
|
|
|
|
|
targets: ['defaults', 'not IE 11'],
|
|
|
|
|
}),
|
|
|
|
|
],
|
2023-05-24 11:08:08 +08:00
|
|
|
|
build: {
|
|
|
|
|
rollupOptions: {
|
|
|
|
|
output: {
|
|
|
|
|
manualChunks: {
|
2023-08-07 18:07:57 +08:00
|
|
|
|
vue: ['vue', 'vue-router', 'pinia', '@vueuse/core', 'vue-i18n'],
|
2023-05-24 11:08:08 +08:00
|
|
|
|
arco: ['@arco-design/web-vue'],
|
|
|
|
|
chart: ['echarts', 'vue-echarts'],
|
2024-07-05 16:00:02 +08:00
|
|
|
|
codeEditor: ['monaco-editor'],
|
2023-05-24 11:08:08 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
chunkSizeWarningLimit: 2000,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
baseConfig
|
|
|
|
|
);
|