vite.config.ts 480 B

12345678910111213141516171819202122
  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. proxy: {
  14. '/api': {
  15. target: 'http://localhost:8080',
  16. changeOrigin: true,
  17. rewrite: (path) => path.replace(/^\/api/, '')
  18. }
  19. }
  20. }
  21. })