vite.config.js 764 B

12345678910111213141516171819202122232425262728293031323334
  1. import { fileURLToPath, URL } from 'node:url'
  2. import { defineConfig, loadEnv } 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(({ mode }) => {
  7. // eslint-disable-next-line no-undef
  8. const env = loadEnv(mode, process.cwd())
  9. console.log(env, 7777)
  10. return {
  11. base: env.VITE_PUBLIC_PATH || '/',
  12. plugins: [
  13. vue(),
  14. ],
  15. resolve: {
  16. alias: {
  17. '@': fileURLToPath(new URL('./src', import.meta.url))
  18. },
  19. },
  20. server: {
  21. host: '0.0.0.0',
  22. port: 5200,
  23. open: true,
  24. proxy: {
  25. '/hyb': {
  26. target: env.VITE_PROXY_TARGET,
  27. changeOrigin: true,
  28. },
  29. },
  30. },
  31. }
  32. })