市场夺宝奇兵
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB

  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(({ mode, command }) => {
  7. // 根据模式设置不同的输出目录
  8. const outDirMap = {
  9. development: 'dist-test', // 测试环境
  10. product: 'dist-prod' // 生产环境
  11. }
  12. return {
  13. plugins: [
  14. vue(),
  15. vueDevTools(),
  16. ],
  17. resolve: {
  18. alias: {
  19. '@': fileURLToPath(new URL('./src', import.meta.url))
  20. },
  21. },
  22. build: {
  23. // 根据模式设置不同的输出目录
  24. outDir: outDirMap[mode] || 'dist',
  25. // 添加多入口配置
  26. rollupOptions: {
  27. input: {
  28. main: './index.html',
  29. download: './hcdbqb-download.html',
  30. guide: './hcdbqb-guide.html',
  31. management: './hcdbqb-management.html'
  32. // 如果你还有其他HTML文件,继续在这里添加
  33. }
  34. }
  35. },
  36. // 开发服务器配置
  37. server: {
  38. port: 5173,
  39. open: true
  40. }
  41. }
  42. })