2025-10-09 15:59:50 +08:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
import react from '@vitejs/plugin-react'
|
2025-10-10 15:09:04 +08:00
|
|
|
import path from 'path'
|
2025-10-21 16:48:48 +08:00
|
|
|
import svgr from "vite-plugin-svgr";
|
2025-10-09 15:59:50 +08:00
|
|
|
|
|
|
|
|
// https://vite.dev/config/
|
|
|
|
|
export default defineConfig({
|
2025-10-21 18:21:48 +08:00
|
|
|
plugins: [
|
|
|
|
|
react(),
|
|
|
|
|
svgr({
|
|
|
|
|
svgrOptions: {
|
|
|
|
|
icon: true,
|
|
|
|
|
prettier: true,
|
2025-10-28 15:28:56 +08:00
|
|
|
},
|
|
|
|
|
}),
|
2025-10-21 18:21:48 +08:00
|
|
|
],
|
2025-10-28 15:28:56 +08:00
|
|
|
build: {
|
|
|
|
|
rollupOptions: {
|
|
|
|
|
output: {
|
|
|
|
|
manualChunks: (id) => {
|
|
|
|
|
// 将所有 SVG 文件打包到一个单独的 chunk 中
|
|
|
|
|
if (id.includes('.svg') && id.includes('?react')) {
|
|
|
|
|
return 'svg-icons';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2025-10-27 15:09:18 +08:00
|
|
|
server: {
|
|
|
|
|
host: '0.0.0.0',
|
|
|
|
|
allowedHosts: ['154.9.253.114', 'localhost', 'teres.deep-pilot.chat'],
|
|
|
|
|
},
|
2025-10-10 15:09:04 +08:00
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': path.resolve(__dirname, './src'),
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-10-09 15:59:50 +08:00
|
|
|
})
|