vite.config.ts 771 B

12345678910111213141516171819202122232425262728293031323334
  1. import { fileURLToPath, URL } from 'node:url'
  2. import { defineConfig } from 'vite'
  3. import vue from '@vitejs/plugin-vue'
  4. import vueDevTools from 'vite-plugin-vue-devtools'
  5. // https://vite.dev/config/
  6. export default defineConfig({
  7. plugins: [
  8. vue(),
  9. vueDevTools(),
  10. ],
  11. resolve: {
  12. alias: {
  13. '@': fileURLToPath(new URL('./src', import.meta.url))
  14. },
  15. },
  16. server: {
  17. // proxy: {
  18. // '/api': {
  19. // target: 'http://47.119.159.155:7687',
  20. // changeOrigin: true,
  21. // rewrite: (path) => path.replace(/^\/api/, '')
  22. // }
  23. // }
  24. proxy: {
  25. '/api': {
  26. target: 'http://api.csqionghua.com/live_data.php',
  27. changeOrigin: true,
  28. rewrite: (path) => path.replace(/^\/api/, '')
  29. }
  30. }
  31. }
  32. })