vite.config.ts 723 B

1234567891011121314151617181920212223242526272829303132
  1. import { fileURLToPath, URL } from 'node:url';
  2. import { defineConfig, loadEnv } from 'vite';
  3. import vue from '@vitejs/plugin-vue';
  4. // https://vitejs.dev/config/
  5. export default defineConfig(({ mode }) => {
  6. const env = loadEnv(mode, __dirname);
  7. return {
  8. base: env.VITE_BASE_URL,
  9. build: {
  10. outDir: env.VITE_OUT_DIR,
  11. },
  12. plugins: [vue()],
  13. server: {
  14. port: 20001,
  15. proxy: {
  16. '/api/live/v0': {
  17. target: 'http://broadcast.waityou24.cn',
  18. },
  19. '/api/util/dbInit': {
  20. target: 'http://broadcast.waityou24.cn',
  21. },
  22. },
  23. },
  24. resolve: {
  25. alias: {
  26. '@': fileURLToPath(new URL('./src', import.meta.url)),
  27. },
  28. },
  29. };
  30. });