市场夺宝奇兵
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.

44 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. const outDirMap = {
  8. development: 'dist-test',
  9. product: 'dist-prod'
  10. }
  11. return {
  12. plugins: [
  13. vue(),
  14. vueDevTools(),
  15. ],
  16. resolve: {
  17. alias: {
  18. '@': fileURLToPath(new URL('./src', import.meta.url))
  19. },
  20. },
  21. build: {
  22. outDir: outDirMap[mode] || 'dist',
  23. rollupOptions: {
  24. input: {
  25. main: './index.html',
  26. download: './hcdbqb-download.html',
  27. guide: './hcdbqb-guide.html',
  28. management: './hcdbqb-management.html'
  29. },
  30. // 配置代码分割
  31. output: {
  32. manualChunks: undefined, // 禁用自动代码分割
  33. chunkFileNames: 'assets/[name]-[hash].js',
  34. entryFileNames: 'assets/[name]-[hash].js'
  35. }
  36. }
  37. },
  38. server: {
  39. port: 5173,
  40. open: true
  41. }
  42. }
  43. })