vite.config.ts 423 B

123456789101112131415161718192021
  1. import { defineConfig } from 'vite';
  2. import vue from '@vitejs/plugin-vue';
  3. import { fileURLToPath, URL } from 'node:url';
  4. export default defineConfig({
  5. plugins: [vue()],
  6. resolve: {
  7. alias: {
  8. '@': fileURLToPath(new URL('./src', import.meta.url)),
  9. },
  10. },
  11. server: {
  12. port: 3000,
  13. proxy: {
  14. '/api': {
  15. target: 'http://localhost:8000',
  16. changeOrigin: true,
  17. },
  18. },
  19. },
  20. });