vite.config.dev.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. '/api/v1': {
  23. // target: 'http://192.168.20.116:1080/',
  24. target: 'http://aiotlink.com:8189',
  25. changeOrigin: true,
  26. ws: true,
  27. // rewrite: (path) => path.replace(new RegExp(`^/upload`), ''),
  28. },
  29. },
  30. // warmup: {
  31. // clientFiles: ['./index.html', './src/{views,components}/*'],
  32. // },
  33. },
  34. plugins: [
  35. eslint({
  36. cache: false,
  37. // include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue'],
  38. include: [''],
  39. exclude: ['node_modules'],
  40. }),
  41. ],
  42. },
  43. baseConfig
  44. );