vite.config.ts 795 B

12345678910111213141516171819202122232425262728293031323334
  1. import { fileURLToPath, URL } from 'node:url';
  2. import { defineConfig, loadEnv } from 'vite';
  3. import vue from '@vitejs/plugin-vue';
  4. export default defineConfig(({ mode }) => {
  5. const env = loadEnv(mode, __dirname);
  6. return {
  7. // 静态路径
  8. base: env.VITE_BASE_URL,
  9. // 打包名称
  10. build: {
  11. outDir: env.VITE_OUT_DIR
  12. },
  13. plugins: [vue()],
  14. server: {
  15. port: 10001,
  16. proxy: {
  17. '/files': {
  18. target: 'https://broadcast.waityou24.cn'
  19. },
  20. '/material/v1/api': {
  21. target: 'http://192.168.255.1:13004',
  22. changeOrigin: true,
  23. ws: false
  24. }
  25. },
  26. fs: { strict: false }
  27. },
  28. resolve: {
  29. alias: {
  30. '@': fileURLToPath(new URL('./src', import.meta.url))
  31. }
  32. }
  33. };
  34. });