vite.config.ts 935 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { defineConfig } from 'vite'
  2. import react from '@vitejs/plugin-react'
  3. import path from 'path'
  4. export default defineConfig({
  5. plugins: [react()],
  6. resolve: {
  7. alias: {
  8. '@': path.resolve(__dirname, './src'),
  9. },
  10. },
  11. server: {
  12. port: 3000,
  13. proxy: {
  14. '/api': {
  15. target: 'http://localhost:8090',
  16. changeOrigin: true,
  17. },
  18. '/ws': {
  19. target: 'ws://localhost:8091',
  20. ws: true,
  21. },
  22. },
  23. },
  24. build: {
  25. outDir: 'dist',
  26. sourcemap: true,
  27. rollupOptions: {
  28. output: {
  29. // Monaco is bundled rather than fetched from a CDN so the app works
  30. // offline, and it dwarfs the app itself. Kept in its own file it is
  31. // downloaded once and stays cached while the app is redeployed.
  32. manualChunks: {
  33. monaco: ['monaco-editor/esm/vs/editor/editor.api'],
  34. },
  35. },
  36. },
  37. chunkSizeWarningLimit: 1500,
  38. },
  39. })