暫無描述

vite.config.js 521B

1234567891011121314151617181920212223242526272829303132
  1. import { defineConfig } from 'vite'
  2. import react from '@vitejs/plugin-react'
  3. export default defineConfig({
  4. plugins: [react()],
  5. server: {
  6. port: 3000,
  7. proxy: {
  8. '/api': {
  9. target: 'http://localhost:5001',
  10. changeOrigin: true,
  11. }
  12. }
  13. },
  14. build: {
  15. outDir: 'build',
  16. sourcemap: false,
  17. },
  18. esbuild: {
  19. loader: 'jsx',
  20. include: /src\/.*\.jsx?$/,
  21. exclude: [],
  22. },
  23. optimizeDeps: {
  24. esbuildOptions: {
  25. loader: {
  26. '.js': 'jsx',
  27. },
  28. },
  29. },
  30. })