vite.config.dev.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { mergeConfig } from 'vite';
  2. import eslint from 'vite-plugin-eslint';
  3. import baseConfig from './vite.config.base';
  4. export default mergeConfig(
  5. {
  6. mode: 'development',
  7. publicPath: './',
  8. server: {
  9. open: true, // 项目启动后,自动打开
  10. fs: {
  11. strict: true,
  12. },
  13. proxy: {
  14. '/basic-api': {
  15. target: 'http://localhost:3000',
  16. changeOrigin: true,
  17. ws: true,
  18. // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
  19. // only https
  20. // secure: false
  21. },
  22. '/v1': {
  23. target: 'http://192.168.20.116:1080/',
  24. changeOrigin: true,
  25. ws: true,
  26. // rewrite: (path) => path.replace(new RegExp(`^/upload`), ''),
  27. },
  28. },
  29. // warmup: {
  30. // clientFiles: ['./index.html', './src/{views,components}/*'],
  31. // },
  32. },
  33. plugins: [
  34. eslint({
  35. cache: false,
  36. // include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue'],
  37. include: [''],
  38. exclude: ['node_modules'],
  39. }),
  40. ],
  41. },
  42. baseConfig
  43. );