You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

pwa.ts 368 B

2 years ago
123456789101112
  1. import { type UserModule } from '~/types'
  2. // https://github.com/antfu/vite-plugin-pwa#automatic-reload-when-new-content-available
  3. export const install: UserModule = ({ isClient, router }) => {
  4. if (!isClient)
  5. return
  6. router.isReady().then(async () => {
  7. const { registerSW } = await import('virtual:pwa-register')
  8. registerSW({ immediate: true })
  9. })
  10. }

No Description