35 lines
986 B
TypeScript
35 lines
986 B
TypeScript
import {fileURLToPath, URL} from 'node:url'
|
|
import svgLoader from 'vite-svg-loader';
|
|
import {defineConfig} from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import cesium from "vite-plugin-cesium";
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
svgLoader(),
|
|
cesium()
|
|
],
|
|
base: './',
|
|
server: {
|
|
port: 8080,
|
|
proxy: {
|
|
'/geoserver': {
|
|
target: 'http://localhost:8443',
|
|
changeOrigin: true, // 确保Host头与目标URL匹配
|
|
rewrite: (path) => path.replace(/^\/geoserver/, ''), // 重写路径
|
|
},
|
|
'/dev_api': {
|
|
target: 'http://localhost:8055',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/dev_api/, ''),
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
}
|
|
})
|