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

34 lines
910 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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