vite.config.ts 609 B

123456789101112131415161718192021222324
  1. import { fileURLToPath, URL } from "node:url"
  2. import { defineConfig } from "vite"
  3. import vue from "@vitejs/plugin-vue"
  4. import vueJsx from "@vitejs/plugin-vue-jsx"
  5. // https://vitejs.dev/config/
  6. export default defineConfig({
  7. plugins: [vue(), vueJsx()],
  8. resolve: {
  9. alias: {
  10. "@": fileURLToPath(new URL("./src", import.meta.url))
  11. }
  12. },
  13. server: {
  14. proxy: {
  15. "/xuqm": {
  16. target: "http://localhost:4562/xuqm",
  17. rewrite: (path) => path.replace(/^\/xuqm/, ""), // 重写路径
  18. changeOrigin: true // target是域名的话,需要这个参数,
  19. }
  20. }
  21. }
  22. })