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/, '')
      },
    }
  },
  plugins: [vue()],
  base:'./',
  publicDir: resolve('static'),
})