vite.config.ts 705 B

123456789101112131415161718192021222324252627282930313233
  1. import { fileURLToPath, URL } from 'node:url'
  2. import { defineConfig } from 'vite'
  3. import vue from '@vitejs/plugin-vue'
  4. const path = require('path')
  5. const common = path.resolve(__dirname, '../common')
  6. export default defineConfig({
  7. plugins: [vue()],
  8. server: {
  9. port: 8001,
  10. proxy: {
  11. '/files': {
  12. target: 'http://basic.waityou24.cn'
  13. },
  14. '/jcyjdtglpt/v1/api': {
  15. target: 'http://basic.waityou24.cn',
  16. changeOrigin: true,
  17. ws: false
  18. }
  19. }
  20. },
  21. resolve: {
  22. alias: {
  23. '@': fileURLToPath(new URL('./src', import.meta.url)),
  24. '@common': common
  25. }
  26. },
  27. // 静态路径
  28. base: '',
  29. // 打包名称
  30. build: {
  31. outDir: ''
  32. }
  33. })