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

60 lines
2.1 KiB

19 hours ago
  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, command }) => {
  7. // 正确加载环境变量 - 只加载 VITE_ 前缀的变量:cite[9]
  8. const env = loadEnv(mode, process.cwd(), 'VITE_')
  9. const outDirMap = {
  10. development: 'dist-test',
  11. production: 'dist-prod'
  12. }
  13. return {
  14. // 确保基础路径正确
  15. base: './',
  16. plugins: [
  17. vue(),
  18. vueDevTools(),
  19. ],
  20. resolve: {
  21. alias: {
  22. '@': fileURLToPath(new URL('./src', import.meta.url))
  23. },
  24. },
  25. build: {
  26. outDir: outDirMap[mode] || 'dist',
  27. rollupOptions: {
  28. input: {
  29. main: './index.html',
  30. download: './hcdbqb-download.html',
  31. guide: './hcdbqb-guide.html',
  32. loginManagement: './login-management.html',
  33. management: './hcdbqb-management.html',
  34. deepchart: './deepchart-management.html',
  35. content: './content-config.html',
  36. hkRegister: './hkRegister.html',//港股市场注册页面
  37. hkRegisterTip: './hkRegisterTip.html',//港股市场注册提示跳转弹窗
  38. hkRegisterSuccess: './hkRegisterSuccess.html',//港股市场注册成功
  39. hkhcdbqbGuide: './hkhcdbqbGuide.html',//港股市场操作指南
  40. hkhcdbqbDownload: './hkhcdbqbDownload.html',//港股市场软件下载
  41. hkhcdbqb: './hkhcdbqb.html',//港股市场首页
  42. hkfeedback: './hkfeedback.html',//港股市场意见反馈
  43. hkhcdbqbManagement: './hkhcdbqbManagement.html',//港股市场管理后台
  44. hkLogiManagement: './hkLogiManagement.html',//港股市场管理后台
  45. },
  46. output: {
  47. entryFileNames: '[name].js', // 入口文件命名
  48. chunkFileNames: '[name].js', // 代码分割块命名
  49. assetFileNames: '[name].[ext]' // 静态资源命名
  50. }
  51. }
  52. },
  53. server: {
  54. port: 5173,
  55. open: true
  56. },
  57. }
  58. })