vite.config.ts 496 B

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