vite.config.js 671 B

123456789101112131415161718192021222324252627282930
  1. import { defineConfig,loadEnv } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import path from "path";
  4. // https://vitejs.dev/config/
  5. export default ({mode})=>defineConfig({
  6. base:loadEnv(mode, process.cwd()).VITE_APP_BASE_URL,
  7. plugins: [
  8. vue()
  9. ],
  10. resolve: {
  11. alias: {
  12. "@": path.resolve(__dirname, "./src"),
  13. },
  14. },
  15. build:{
  16. outDir:loadEnv(mode, process.cwd()).VITE_APP_OUTDIR
  17. },
  18. server:{
  19. host:'0.0.0.0',
  20. proxy: {
  21. '/api': {
  22. // target: 'http://8.136.199.33:8608',
  23. target: 'http://gnetareport.hzinsights.com/ybreport',
  24. changeOrigin: true,
  25. rewrite: (path) => path.replace(/^\/api/, '/api')
  26. }
  27. },
  28. }
  29. })