You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
921 B

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. import { defineConfig } from 'vite'
  2. import react from '@vitejs/plugin-react'
  3. import { viteMockServe } from 'vite-plugin-mock'
  4. //import { TanStackRouterVite } from '@tanstack/router-vite-plugin'
  5. // https://vitejs.dev/config/
  6. export default defineConfig({
  7. //定义别名的路径
  8. resolve: {
  9. alias: {
  10. '@': '/src',
  11. },
  12. },
  13. server: {
  14. proxy: {
  15. '/api': {
  16. target: 'https://proapi.devwork.top',
  17. changeOrigin: true,
  18. rewrite: (path) => path
  19. }
  20. }
  21. },
  22. plugins: [
  23. react(),
  24. viteMockServe({
  25. // 是否启用 mock 功能(默认值:process.env.NODE_ENV !== 'production')
  26. enable: false,
  27. // mock 文件的根路径,默认值:'mocks'
  28. mockPath: 'mock',
  29. logger: true,
  30. }),
  31. //TanStackRouterVite(),
  32. ],
  33. })