vite.config.js 667B

12345678910111213141516171819202122232425262728293031323334
  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. server: {
  7. port: 3001,
  8. host: '0.0.0.0',
  9. proxy: {
  10. '/api': {
  11. target: 'http://127.0.0.1:9087',
  12. // target: 'http://t.njyz.tech',
  13. changeOrigin: true,
  14. },
  15. }
  16. },
  17. plugins: [
  18. react(),
  19. ],
  20. resolve: {
  21. alias: [
  22. { find: '@', replacement: path.resolve(__dirname, 'src') },
  23. ],
  24. },
  25. css: {
  26. preprocessorOptions: {
  27. less: {
  28. // modifyVars: { 'primary-color': '#13c2c2' },
  29. javascriptEnabled: true,
  30. },
  31. },
  32. },
  33. })