123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import { fileURLToPath, URL } from 'node:url'
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import cesium from 'vite-plugin-cesium'
- // https://vitejs.dev/config/
- export default defineConfig({
- base: './', // 确保与部署路径匹配
- plugins: [
- vue(),
- cesium({
- // 关键配置:强制插件处理资源路径
- rebuildCesium: true
- })
- ],
- build: {
- // 确保资源文件不被重命名
- assetsInlineLimit: 0
- },
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url)),
- 'assets': fileURLToPath(new URL('./assets', import.meta.url)),
- '@three': fileURLToPath(new URL('./Three', import.meta.url))
- }
- },
- server: {
- proxy: {
- '/ventusky': {
- target: 'https://www.ventusky.com',
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/ventusky/, '')
- },
- '/nomads': {
- target: 'https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p50.pl',
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/nomads/, '')
- }
- }
- }
- })
|