vite.config.ts 908 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. "/api": {
  16. // target: "http://localhost:8071",
  17. target: "http://172.16.0.255:8071",
  18. changeOrigin: true,
  19. rewrite: (path) => path.replace(/^\/gw/, ""),
  20. },
  21. "/login": {
  22. target: "http://localhost:8071",
  23. changeOrigin: true,
  24. },
  25. "/user": {
  26. target: "http://localhost:8071",
  27. changeOrigin: true,
  28. }
  29. },
  30. host: "0.0.0.0"
  31. },
  32. css: {
  33. preprocessorOptions: {
  34. less: {
  35. javascriptEnabled: true,
  36. },
  37. },
  38. },
  39. });