@julien-lin/universal-pwa-templates
v1.3.3
Published
Service worker templates for UniversalPWA
Downloads
1,491
Maintainers
Readme
@julien-lin/universal-pwa-templates
Service worker templates for UniversalPWA, adapted to different architectures (static, SPA, SSR) and framework variants (Next.js/Nuxt, WordPress, Laravel, Symfony).
Installation
npm install @julien-lin/universal-pwa-templatesOr with pnpm:
pnpm add @julien-lin/universal-pwa-templatesUsage
import { getServiceWorkerTemplate } from '@julien-lin/universal-pwa-templates'
const template = getServiceWorkerTemplate({
architecture: 'spa',
framework: 'react',
})
console.log(template) // Service worker template contentSupported Templates
- Static : For static HTML/CSS/JS sites
- SPA : For Single Page Applications (React, Vue, Angular)
- SSR : For Server-Side Rendered apps (Next.js, Nuxt)
- WordPress : Optimized for WordPress themes
- PHP : For PHP frameworks (Laravel, Symfony)
API
getServiceWorkerTemplate(options): Get the appropriate service worker templategetTemplateForArchitecture(architecture): Get template for a specific architecturegetTemplateForFramework(framework): Get template for a specific framework
💝 Sponsoring
If UniversalPWA is useful to you, please consider sponsoring the project to help maintain and improve it.
Links
- Repository: https://github.com/julien-lin/UniversalPWA
- Issues: https://github.com/julien-lin/UniversalPWA/issues
- Discussions: https://github.com/julien-lin/UniversalPWA/discussions
- Contributing: https://github.com/julien-lin/UniversalPWA/blob/main/CONTRIBUTING.md
- Releases: https://github.com/julien-lin/UniversalPWA/releases
- Sponsor: https://github.com/sponsors/julien-lin
- npm Package: https://www.npmjs.com/package/@julien-lin/universal-pwa-templates
