vite.config.js 832B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { defineConfig } from "vite";
  2. import path from "path";
  3. import react from "@vitejs/plugin-react";
  4. import vitePluginImp from "vite-plugin-imp";
  5. // https://vitejs.dev/config/
  6. export default defineConfig({
  7. base: '',
  8. server: {
  9. port: 3000,
  10. host: "0.0.0.0",
  11. proxy: {
  12. "/api": {
  13. target: "http://192.168.89.25:7009",
  14. changeOrigin: true,
  15. },
  16. },
  17. },
  18. plugins: [
  19. react(),
  20. vitePluginImp({
  21. libList: [
  22. {
  23. libName: "antd",
  24. style: (name) => `antd/es/${name}/style`,
  25. },
  26. ],
  27. })
  28. ],
  29. resolve: {
  30. alias: [{ find: "@", replacement: path.resolve(__dirname, "src") }],
  31. },
  32. css: {
  33. preprocessorOptions: {
  34. less: {
  35. // modifyVars: { 'primary-color': '#13c2c2' },
  36. javascriptEnabled: true,
  37. },
  38. },
  39. },
  40. });