vite.config.ts 635 B

1234567891011121314151617181920212223242526272829
  1. import { defineConfig } from "vite";
  2. import react from "@vitejs/plugin-react";
  3. import path from "path";
  4. // https://vitejs.dev/config/
  5. export default defineConfig({
  6. plugins: [react()],
  7. server: {
  8. proxy: {
  9. "/api": {
  10. target: "http://localhost:5559",
  11. changeOrigin: true,
  12. },
  13. },
  14. },
  15. css: {
  16. modules: {
  17. localsConvention: "camelCaseOnly", // transfer kebab-case to camelCase
  18. scopeBehaviour: "local",
  19. generateScopedName: "[name]__[local]___[hash:base64:5]",
  20. },
  21. },
  22. publicDir: "public",
  23. resolve: {
  24. alias: {
  25. "@": path.resolve(__dirname, "./src"),
  26. },
  27. },
  28. });