vite.config.dev.ts 1.6 KB

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