vite.config.dev.ts 859 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { mergeConfig } from 'vite'
  2. import eslint from 'vite-plugin-eslint'
  3. import { viteMockServe } from 'vite-plugin-mock'
  4. import baseConfig from './vite.config.base'
  5. export default mergeConfig(
  6. {
  7. mode: 'development',
  8. server: {
  9. proxy: {
  10. '/api/': {
  11. target: 'https://pmr.surkw.com:1443',
  12. secure: false,
  13. changeOrigin: true
  14. }
  15. }
  16. },
  17. plugins: [
  18. viteMockServe({
  19. ignore: /^_/,
  20. mockPath: 'src/mock',
  21. localEnabled: false,
  22. prodEnabled: true,
  23. injectCode: `
  24. import { setupProdMockServer } from './mock/_createProductionServer'
  25. setupProdMockServer()`
  26. }),
  27. eslint({
  28. cache: false,
  29. include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue'],
  30. exclude: ['node_modules']
  31. })
  32. ]
  33. },
  34. baseConfig
  35. )