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 );