1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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,
- resolve: {
- alias: {
- // 将 ArcGIS API 本地路径指向 node_modules 中的 `@arcgis/core`
- '@arcgis/core': path.resolve(__dirname, 'node_modules/@arcgis/core')
- }
- },
- 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/, '')
- },
- '/zwapi': {
- // 代理请求之后的请求地址(你的真实接口地址)
- target: 'https://cimweb.zjw.sh.cegn.cn:2008/',
- //target: 'http://10.1.163.15:19259/DataSearch/',
- //target: 'http://localhost:9250/',
- secure: false,
- ws: true,
- // 跨域
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/zwapi/, '')
- },
- '/netapi': {
- // 代理请求之后的请求地址(你的真实接口地址)
- target: 'http://58.34.215.19:8100/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'),
- })
|