import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

const isDev = process.env.NODE_ENV === "development";
// import vueDevTools from 'vite-plugin-vue-devtools'

// https://vite.dev/config/
export default defineConfig({
  base: "./",
  build: {
    // assetsDir: "assets",
    // outDir: 'dist', // 输出目录
    // emptyOutDir: true,
    copyPublicDir: false,
  },
  plugins: [
    vue(),
    // vueDevTools(),
  ],
  server: {
    host: "0.0.0.0",
    proxy: {
      // "/api": {
      //   target: "https://hn3dreal.org.cn", // 后端服务地址
      //   changeOrigin: true, // 是否改变源地址
      //   // rewrite: (path) => path.replace(/^\/api/, ""),
      // },
    },
  },
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
});
