vite.config.js 785 B

1234567891011121314151617181920212223242526272829303132333435
  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. vueDevTools(),
  15. ],
  16. resolve: {
  17. alias: {
  18. '@': fileURLToPath(new URL('./src', import.meta.url))
  19. },
  20. },
  21. server: {
  22. host: '0.0.0.0',
  23. port: 8888,
  24. open: true,
  25. proxy: {
  26. '/hyb': {
  27. target: env.VITE_PROXY_TARGET,
  28. changeOrigin: true,
  29. },
  30. },
  31. },
  32. }
  33. })