import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import legacy from '@vitejs/plugin-legacy' import path from 'path' // https://vitejs.dev/config/ export default defineConfig({ plugins: [ vue(), legacy({ polyfills: ['es.promise.finally', 'es/map', 'es/set'], modernPolyfills: ['es.promise.finally'] }) ], server: { port: 3000, cors: true, host: '0.0.0.0', proxy: { '/v1': { // target: 'http://8.136.199.33:8608', target: 'https://charttest.hzinsights.com', changeOrigin: true, rewrite: (path) => path.replace(/^\/v1/, '/v1') } }, }, build: { outDir: 'eta_chart_front', chunkSizeWarningLimit: 1000,//单文件过1000kb警告 }, resolve: { alias: { '@': path.resolve(__dirname, './src') }, }, css: { postcss: { plugins: [ { postcssPlugin: 'internal:charset-removal', AtRule: { charset: (atRule) => { if (atRule.name === 'charset') { atRule.remove() } } } } ] } } })