// vite.config.ts
import { defineConfig, loadEnv } from "file:///F:/airopt/airoptweb/node_modules/vite/dist/node/index.js";
import vue from "file:///F:/airopt/airoptweb/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import { resolve } from "path";
import AutoImport from "file:///F:/airopt/airoptweb/node_modules/unplugin-auto-import/dist/vite.js";
import Components from "file:///F:/airopt/airoptweb/node_modules/unplugin-vue-components/dist/vite.mjs";
import VueSetupExtend from "file:///F:/airopt/airoptweb/node_modules/vite-plugin-vue-setup-extend/dist/index.mjs";
var vite_config_default = defineConfig(({ mode }) => {
  const config = loadEnv(mode, "./");
  console.log(config);
  return {
    base: "./",
    plugins: [
      vue(),
      AutoImport({
        //安装两行后你会发现在组件中不用再导入ref，reactive等
        imports: ["vue", "vue-router"],
        //存放的位置
        dts: "src/auto-import.d.ts"
      }),
      Components({
        // 引入组件的,包括自定义组件，存放的位置
        dts: "src/components.d.ts"
      }),
      VueSetupExtend()
    ],
    //1、 ↓解析配置
    resolve: {
      // ↓路径别名
      alias: {
        "@": resolve("src")
      }
    },
    //代理
    server: {
      proxy: {
        "/api": {
          target: "http://192.168.0.131:8188/TransServlet",
          //配置文件获取地址
          // target: 'http://192.168.0.108:8188/TransServlet',
          secure: false,
          //接受使用https
          changeOrigin: true,
          //允许跨域
          ws: false,
          //使用websocket
          rewrite: (path) => path.replace(/^\/api/, "")
        },
        "/file": {
          // target: 'http://192.168.0.15:8081/', // 后端接口地址
          target: "http://192.168.0.43:2201/",
          secure: false,
          //接受使用https
          changeOrigin: true,
          //允许跨域
          ws: false,
          //使用websocket
          pathRewrite: {
            // 路径重写
            "^/file": ""
          }
        },
        "/websokct": {
          target: "http://192.168.0.104:8188",
          // target: 'http://192.168.0.43:8081/',
          // target: 'https://www.gzchain.org.cn/managersvc/', //后端接口地址
          secure: false
          //接受使用https
        }
      }
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,[encoded data, 6080 characters]
