import { defineConfig } from 'vite' import path from 'path' import react from '@vitejs/plugin-react' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' // https://vitejs.dev/config/ export default defineConfig({ base: '/', plugins: [ react(), createSvgIconsPlugin({ iconDirs: [path.resolve(process.cwd(),'src/assets/svg')], symbolId: 'icon-[dir]-[name]' }) ], resolve: { alias: { '@': path.resolve(__dirname, 'src') } }, build: { minify: 'esbuild', terserOptions: { compress: { drop_console: false, drop_debugger: false, } } }, server: { host: '0.0.0.0', open: true, cors: true, port: 7777, hmr:{ overlay: false }, proxy: { '/api': { target: 'http://gateway.feashow.cn', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ''), }, } } })