vite.config.ts 620 B

123456789101112131415161718192021222324252627
  1. import { fileURLToPath, URL } from 'node:url'
  2. import { defineConfig } from 'vite'
  3. import vue from '@vitejs/plugin-vue'
  4. import vueJsx from '@vitejs/plugin-vue-jsx'
  5. // https://vitejs.dev/config/
  6. export default defineConfig({
  7. plugins: [vue(), vueJsx()],
  8. resolve: {
  9. alias: {
  10. '@': fileURLToPath(new URL('./src', import.meta.url))
  11. }
  12. },
  13. server: {
  14. host: '0.0.0.0',
  15. port: 5177,
  16. proxy: {
  17. '/api': {
  18. target: 'http://localhost:9902',
  19. //target: 'http://58.87.69.234:9902',
  20. changeOrigin: true,
  21. rewrite: (path) => path.replace(/^\/api/, '')
  22. }
  23. }
  24. }
  25. })