vite.config.ts 700 B

123456789101112131415161718192021222324252627282930
  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: "https://staging.openxlab.org.cn/datasets",
  11. target: "http://10.6.16.169:5559",
  12. changeOrigin: true,
  13. },
  14. },
  15. },
  16. css: {
  17. modules: {
  18. localsConvention: "camelCaseOnly", // transfer kebab-case to camelCase
  19. scopeBehaviour: "local",
  20. generateScopedName: "[name]__[local]___[hash:base64:5]",
  21. },
  22. },
  23. publicDir: "public",
  24. resolve: {
  25. alias: {
  26. "@": path.resolve(__dirname, "./src"),
  27. },
  28. },
  29. });