pwa.ts 663 B

12345678910111213141516171819202122232425262728293031
  1. import { VitePWA } from 'vite-plugin-pwa';
  2. export default function setupVitePwa() {
  3. return VitePWA({
  4. registerType: 'autoUpdate',
  5. includeAssets: ['favicon.ico'],
  6. manifest: {
  7. name: 'SoybeanAdmin',
  8. short_name: 'SoybeanAdmin',
  9. theme_color: '#fff',
  10. icons: [
  11. {
  12. src: '/logo.png',
  13. sizes: '192x192',
  14. type: 'image/png'
  15. },
  16. {
  17. src: '/logo.png',
  18. sizes: '512x512',
  19. type: 'image/png'
  20. },
  21. {
  22. src: '/logo.png',
  23. sizes: '512x512',
  24. type: 'image/png',
  25. purpose: 'any maskable'
  26. }
  27. ]
  28. }
  29. });
  30. }