vite.config.js 717 B

12345678910111213141516171819202122232425262728293031
  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: true,
  14. proxy: {
  15. // 使用 /dev-api 前缀,与 RobotSpineWeb 保持一致
  16. '/dev-api': {
  17. //target: 'http://192.168.0.30:8080',
  18. target: 'http://localhost:8080',
  19. changeOrigin: true,
  20. rewrite: (path) => path.replace(/^\/dev-api/, '')
  21. }
  22. }
  23. },
  24. build: {
  25. outDir: 'dist',
  26. assetsDir: 'assets',
  27. sourcemap: false,
  28. chunkSizeWarningLimit: 1000
  29. }
  30. })