Files
yunrui_asset/frontend/vite.config.js
T

49 lines
1.1 KiB
JavaScript
Raw Normal View History

2025-12-18 10:45:13 +08:00
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
assetsInclude: ['**/*.hdr', '**/*.woff2'],
2025-12-18 10:45:13 +08:00
server: {
2025-12-20 10:37:26 +08:00
host: '0.0.0.0',
2025-12-18 10:45:13 +08:00
port: 3000,
proxy: {
'/api': {
target: 'http://localhost:8000',
2025-12-18 10:45:13 +08:00
changeOrigin: true
},
'/uploads': {
target: 'http://localhost:8000',
changeOrigin: true
2025-12-18 10:45:13 +08:00
}
}
},
build: {
outDir: 'dist',
sourcemap: false,
rollupOptions: {
output: {
manualChunks: {
'antd': ['antd', '@ant-design/icons'],
'vendor': ['react', 'react-dom', 'react-router-dom'],
'charts': ['axios', 'dayjs'],
'utils': ['three', 'xlsx']
},
chunkFileNames: 'js/[name]-[hash].js',
entryFileNames: 'js/[name]-[hash].js',
assetFileNames: '[ext]/[name]-[hash].[ext]',
compact: true
}
},
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
}
}
},
optimizeDeps: {
include: ['antd', '@ant-design/icons', 'axios', 'react-router-dom']
2025-12-18 10:45:13 +08:00
}
});