vite.config.js 702 B

123456789101112131415161718192021222324252627282930313233
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. const proxyTarget = {
  4. target: 'http://localhost:9001'
  5. }
  6. // https://vitejs.dev/config/
  7. export default defineConfig({
  8. base: process.env.NODE_ENV === 'production' ? '/assets/js/themes/' : './',
  9. plugins: [
  10. vue()
  11. ],
  12. resolve: {
  13. extensions: ['.js', '.vue', '.json']
  14. },
  15. build: {
  16. rollupOptions: {
  17. input: process.env.NODE_ENV === 'production' ? 'themes.html' : 'index.html',
  18. }
  19. },
  20. server: {
  21. host: '0.0.0.0',
  22. https: false,
  23. hotOnly: false,
  24. proxy: {
  25. '/favicon.png': proxyTarget,
  26. '/assets': proxyTarget,
  27. '/docs': proxyTarget,
  28. '/themes': proxyTarget
  29. }
  30. }
  31. })