vite.config.ts 951 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import path from 'path';
  4. import legacy from '@vitejs/plugin-legacy'
  5. // https://vitejs.dev/config/
  6. export default defineConfig({
  7. plugins: [
  8. vue(),
  9. legacy({
  10. targets: ['ie >= 8'],
  11. additionalLegacyPolyfills: ['regenerator-runtime/runtime']
  12. })
  13. ],
  14. // build: {
  15. // outDir: 'E:\\Projects\\chemopump\\tuoren-pump-chemo\\src\\main\\resources\\static',
  16. // emptyOutDir: true,
  17. // },
  18. resolve: {
  19. alias: {
  20. '@': path.resolve(__dirname, './src')
  21. }
  22. },
  23. server: {
  24. host: '0.0.0.0',
  25. port: 3000,
  26. proxy: {
  27. '/forward-service': {
  28. target: 'http://192.168.103.33:8585/',
  29. // target: 'http://192.168.100.115:8585/', // 生产环境
  30. changeOrigin: true,
  31. rewrite: (path) => {
  32. // console.log('path', path)
  33. return path.replace(/^\/forward-service/, '')
  34. }
  35. }
  36. }
  37. }
  38. })