next-pwa-turbo
v0.1.0
Published
Bundler-agnostic PWA helper for Next.js (App Router, Turbopack/Webpack) inspired by next-pwa
Maintainers
Readme
next-pwa-turbo
Bundler-agnostic PWA helper for Next.js (App Router, Turbopack/Webpack) inspired by next-pwa.
Features
- ✅ Bundler-agnostic (Turbopack, Webpack)
- ✅ Next.js 14+ App Router support
- ✅ TypeScript with full type safety
- ✅ Smart asset discovery from build manifests
- ✅ Configurable runtime caching strategies
- ✅ Automatic manifest generation
Installation
npm install next-pwa-turboQuick Start
1. Configure Next.js
// next.config.js
import { withPWA } from 'next-pwa-turbo';
export default withPWA({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
})({
// Your Next.js config
});2. Update Build Script
{
"scripts": {
"build": "next build && next-pwa-turbo build"
}
}3. Register Service Worker
// app/layout.tsx
import { PWAInstallPrompt } from 'next-pwa-turbo/client';
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<PWAInstallPrompt />
</body>
</html>
);
}License
MIT
