vite.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import {fileURLToPath, URL} from 'node:url'
  2. import {defineConfig} from 'vite'
  3. import vue from '@vitejs/plugin-vue'
  4. import tryFiles from "./src/lib/try_files.js"
  5. // https://vitejs.dev/config/
  6. export default defineConfig({
  7. plugins: [
  8. tryFiles,
  9. vue()
  10. ],
  11. resolve: {
  12. alias: {
  13. '@': fileURLToPath(new URL('./src', import.meta.url))
  14. }
  15. },
  16. server: {
  17. host: '0.0.0.0',
  18. port: 5174
  19. },
  20. root: 'src',
  21. publicDir: '@/public',
  22. build: {
  23. rollupOptions: {
  24. input: [
  25. '@/views/index/index.html',
  26. '@/views/account/reset.html',
  27. '@/views/email/verify.html',
  28. '@/views/login/index.html',
  29. '@/views/login/ticket.html',
  30. '@/views/login/otp.html',
  31. '@/views/register/index.html',
  32. '@/views/layout.html',
  33. /** portal **/
  34. '@/views/portal/index.html',
  35. '@/views/portal/post.html',
  36. '@/views/portal/products/index.html',
  37. '@/views/portal/products/cdn/index.html',
  38. ],
  39. output: {
  40. assetFileNames: 'views/assets/app-[hash].[ext]',
  41. entryFileNames: 'views/assets/app-[hash].js',
  42. chunkFileNames: 'views/assets/app-[hash].js',
  43. dir: 'dist'
  44. }
  45. },
  46. chunkSizeWarningLimit: 2048
  47. }
  48. })