vite.config.ts 569 B

1234567891011121314151617181920212223242526
  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: 5173,
  13. host: '0.0.0.0',
  14. proxy: {
  15. '/api': {
  16. target: 'http://localhost:8086',
  17. changeOrigin: true,
  18. configure: (proxy) => {
  19. proxy.on('proxyReq', (proxyRequest) => proxyRequest.removeHeader('origin'))
  20. },
  21. },
  22. },
  23. },
  24. })