MeterSphere/frontend/config/vite.config.prod.ts

34 lines
910 B
TypeScript
Raw Permalink Normal View History

2023-05-24 11:08:08 +08:00
import configCompressPlugin from './plugin/compress';
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';
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
);