36 lines
766 B
TypeScript
36 lines
766 B
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'path';
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
port: 5122,
|
|
strictPort: true,
|
|
allowedHosts: ['.local'],
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:4005',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
sourcemap: true,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
'vendor-react': ['react', 'react-dom', 'react-router-dom'],
|
|
'vendor-charts': ['recharts'],
|
|
'vendor-maps': ['react-simple-maps', 'topojson-client'],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|