vite.config.dev.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. '/base': {
  15. target: 'http://aiotlink.com:8189',
  16. changeOrigin: true,
  17. ws: true,
  18. // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
  19. // only https
  20. // secure: false
  21. },
  22. '/api': {
  23. // target: 'http://192.168.20.116:1080',
  24. // target: 'http://192.168.20.158:8089',
  25. target: 'http://aiotlink.com:8189',
  26. changeOrigin: true,
  27. ws: true,
  28. // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
  29. },
  30. '/api/v1': {
  31. // target: 'http://192.168.20.116:1080',
  32. // target: 'http://192.168.20.158:8089',
  33. target: 'http://aiotlink.com:8189',
  34. changeOrigin: true,
  35. ws: true,
  36. // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
  37. },
  38. },
  39. // warmup: {
  40. // clientFiles: ['./index.html', './src/{views,components}/*'],
  41. // },
  42. },
  43. plugins: [
  44. eslint({
  45. cache: false,
  46. // include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue'],
  47. include: [''],
  48. exclude: ['node_modules'],
  49. }),
  50. ],
  51. },
  52. baseConfig
  53. );