vite.config.js 672B

12345678910111213141516171819202122232425262728293031
  1. import { defineConfig } from "vite";
  2. import path from "path";
  3. import react from "@vitejs/plugin-react";
  4. // https://vitejs.dev/config/
  5. export default defineConfig({
  6. // base: "/admin/",
  7. server: {
  8. port: 3001,
  9. host: "0.0.0.0",
  10. proxy: {
  11. "/api": {
  12. target: "http://localhost:9087",
  13. // target: 'http://t.njyz.tech',
  14. changeOrigin: true,
  15. },
  16. },
  17. },
  18. plugins: [react()],
  19. resolve: {
  20. alias: [{ find: "@", replacement: path.resolve(__dirname, "src") }],
  21. },
  22. css: {
  23. preprocessorOptions: {
  24. less: {
  25. // modifyVars: { 'primary-color': '#13c2c2' },
  26. javascriptEnabled: true,
  27. },
  28. },
  29. },
  30. });