Introduction
What does this plugin do?
It uses workbox-build to generate a Service Worker (SW) that precaches (by default) all assets emitted by Rsbuild. It also generates a SW registration script and a web app manifest, and injects them into HTML. Every step except SW generation is optional, so you can register the SW and add the web app manifest manually.
Limitations
- HTML plugin is required to inject the SW registration script and the web app manifest link. If it's disabled, you'll need to perform these steps manually.
- Only
rsbuild buildcommand is supported, so the plugin doesn't work in dev mode.