vite.config.ts 794 B

123456789101112131415161718192021222324252627282930313233343536
  1. import react from "@vitejs/plugin-react";
  2. import { defineConfig } from "vite";
  3. import { nodePolyfills } from "vite-plugin-node-polyfills";
  4. export default defineConfig(({ mode }) => ({
  5. plugins: [react(), nodePolyfills()],
  6. resolve: {
  7. alias: {
  8. assets: "/src/assets",
  9. components: "/src/components",
  10. legacy: "/src/legacy",
  11. lib: "/src/lib",
  12. main: "/src/main",
  13. shared: "/src/shared",
  14. utils: "/src/utils",
  15. },
  16. },
  17. build: {
  18. outDir: "build",
  19. },
  20. ...(mode === "development" && {
  21. envDir: "../zarf/helm",
  22. }),
  23. server: {
  24. port: 8081,
  25. proxy: {
  26. ...(mode === "development" && {
  27. "/api": {
  28. target: "http://localhost:8080",
  29. changeOrigin: true,
  30. ws: true,
  31. },
  32. }),
  33. },
  34. },
  35. }));