1.0.1 β’ Published 3 years ago
nextjs-pwa v1.0.1
Zero-config PWA plugin for Next.js
This plugin is powered by Workbox and other good stuff.
π Share your awesome PWA project π here
Features
- 0οΈβ£ Zero-config for registering and generating service worker out of the box
- β¨ Optimized precaching and runtime caching
- π― Maximal Lighthouse score
- π Easy-to-understand examples
- π΄ Offline support with fallbacks (example)
- π¦ Uses Workbox and workbox-window v6
- πͺ Works with cookies out of the box
- π Default range requests for audios and videos
- β No custom server needed for Next.js 9+ (example)
- π§ Handle PWA lifecycle events (opt-in - example)
- π Custom worker to run extra code with code splitting and Typescript support (example)
- π Public environment variables are available in custom workers
- π Debug service worker in development mode without caching
- π Internationalization support (a.k.a i18n) with
next-i18next(example) - π Configurable by Workbox's options for GenerateSW and InjectManifest
- β‘ Supports blitz.js (simply add
blitz.config.js) - π Spin up a GitPod and try out examples in rocket speed (or use
create-next-appto create a brand new Next.js app with them (for example, runpnpm create next-app --example https://github.com/DuCanhGH/next-pwa/tree/master/examples/basicto create a new Next.js app using thebasicexample))
NOTE 1 -
next-pwaversion 2.0.0+ should only work withNext.js9.1+, and static files should only be served through thepublicdirectory.NOTE 2 - If you encounter the error
TypeError: Cannot read property **'javascript' of undefined**during build, please consider upgrading to Webpack 5 innext.config.js.NOTE 3 -
nextjs-pwacurrently doesn't support Turbopack, but I will start working on it as soon as we get our hands on Turbopack. It may not use Workbox anymore depending on Workbox's maintain status, however.
Setup
Tips
See our tips on using next-pwa