2024-07-07 01:58:23 +08:00
|
|
|
import { fileURLToPath, URL } from 'node:url'
|
2024-10-08 22:16:17 +08:00
|
|
|
import { defineConfig, loadEnv } from 'vite'
|
2024-07-07 01:58:23 +08:00
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
|
|
2024-10-08 22:16:17 +08:00
|
|
|
export default defineConfig(({ mode }) => {
|
2026-03-26 13:53:35 +08:00
|
|
|
// eslint-disable-next-line no-undef
|
2024-10-08 22:16:17 +08:00
|
|
|
const env = loadEnv(mode, process.cwd(), '')
|
|
|
|
|
return {
|
|
|
|
|
plugins: [vue()],
|
|
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
2024-07-07 01:58:23 +08:00
|
|
|
}
|
|
|
|
|
},
|
2026-07-14 15:13:29 +08:00
|
|
|
optimizeDeps: {
|
|
|
|
|
include: [
|
|
|
|
|
'echarts',
|
|
|
|
|
'echarts/core',
|
|
|
|
|
'echarts/charts',
|
|
|
|
|
'echarts/components',
|
|
|
|
|
'echarts/renderers'
|
|
|
|
|
]
|
|
|
|
|
},
|
2024-10-08 22:16:17 +08:00
|
|
|
server: {
|
|
|
|
|
proxy: {
|
|
|
|
|
'^/api': {
|
2025-11-14 11:00:57 +08:00
|
|
|
target: env.VITE_API_URL || 'http://api:5050',
|
2026-01-04 11:43:08 +08:00
|
|
|
changeOrigin: true
|
2024-10-08 22:16:17 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
2024-11-23 11:13:36 +08:00
|
|
|
usePolling: true,
|
2024-10-08 22:16:17 +08:00
|
|
|
ignored: ['**/node_modules/**', '**/dist/**'],
|
|
|
|
|
},
|
|
|
|
|
host: '0.0.0.0',
|
|
|
|
|
}
|
2024-07-07 01:58:23 +08:00
|
|
|
}
|
|
|
|
|
})
|