123456789101112131415161718192021222324252627282930313233343536373839 |
- import * as path from "path";
- const resolve = (dir) => path.resolve(__dirname, dir);
- import { fileURLToPath, URL } from 'node:url'
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- // https://vitejs.dev/config/
- export default defineConfig({
- server:{
- cors: true,
- proxy: {
- '/api': {
- // 代理请求之后的请求地址(你的真实接口地址)
- target: 'http://10.90.9.143:9252/DataSearch/',
- //target: 'http://localhost:9250/',
- secure: false,
- ws: true,
- // 跨域
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/api/, '')
- },
- '/netapi': {
- // 代理请求之后的请求地址(你的真实接口地址)
- // target: 'http://58.34.215.19:19259/DataSearch/',
- target: 'http://10.1.163.15:19259/DataSearch/',
- //target: 'http://localhost:9250/',
- secure: false,
- ws: true,
- // 跨域
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/netapi/, '')
- },
- }
- },
- plugins: [vue()],
- base:'/map-tool-widget-4301227/',
- publicDir: resolve('static'),
- })
|