You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import { mergeConfig } from 'vite';
|
|
import baseConfig from './vite.config.base';
|
|
import configCompressPlugin from './plugin/compress';
|
|
import configArcoResolverPlugin from './plugin/arcoResolver';
|
|
import configStyleImportPlugin from './plugin/styleImport';
|
|
import configImageminPlugin from './plugin/imagemin';
|
|
|
|
export default mergeConfig(
|
|
{
|
|
mode: 'production',
|
|
plugins: [
|
|
configCompressPlugin('gzip'),
|
|
configArcoResolverPlugin(),
|
|
configStyleImportPlugin(),
|
|
configImageminPlugin(),
|
|
],
|
|
build: {
|
|
assetsDir: 'assets',
|
|
chunkSizeWarningLimit: 2000,
|
|
cssCodeSplit: false,
|
|
emptyOutDir: true,
|
|
esbuild: {
|
|
drop: ['console', 'debugger'],
|
|
minify: true,
|
|
pure: ['console.log'],
|
|
},
|
|
outDir: 'dist',
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
arco: ['@arco-design/web-vue'],
|
|
chart: ['echarts', 'vue-echarts'],
|
|
vue: ['vue', 'vue-router', 'pinia', '@vueuse/core', 'vue-i18n'],
|
|
},
|
|
},
|
|
},
|
|
sourcemap: false,
|
|
target: 'es2020',
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/v3/api': {
|
|
target: 'http://101.133.164.208:8080/',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/v3\/api/, ''),
|
|
},
|
|
},
|
|
},
|
|
},
|
|
baseConfig
|
|
);
|