Skip to content

Repository files navigation

unplugin-pwa - PWA Ecosystem

PWA Ecosystem

Docs & Guides
GitHub stars


Anthony Fu SVG sponsors image

🧩 Why a Modular Ecosystem?

The new architecture shifts the responsibility away from rigid configurations toward an extensible, programmatic pipeline where integrations and meta-frameworks know exactly what to do.

  • Granular and Modular: Instead of forcing you into a single monolithic config, you can now compose your PWA layer using low-level plugin pieces or stick to the simple application-level wrapper.
  • Universal Bundler Support (unplugin): By embracing the unplugin architecture, the ecosystem breaks free from Vite-only constraints. It now provides native, first-class adapters for Webpack, Rspack, Rsbuild, and Rolldown, ensuring a unified and consistent PWA configuration API regardless of your underlying build tool.
  • Next-Gen Meta-Framework Logic: Meta-framework integrations (Nuxt, SvelteKit, Astro, VitePress, etc.) are getting a massive logic simplification. The underlying core plugins will handle the orchestration natively without complex boilerplate hacks.
  • Vite Environment API Ready: The new core is built looking forward. It comes with out-of-the-box support for Vite 8 and features on-demand activation for the new Vite Environment API (introduced at Vite 6). The underlying framework integrations will automatically tap into these environments when required—only when activated on demand—meaning zero dead weight for standard builds.
  • Smart Dual-Registration & Zero-Overhead DCE: When Dual Build is active, the generated virtual modules utilize the esm-sw-detector to dynamically register the ESM or Classic variant depending on browser capabilities. However, if the consumer configures a single baseline build (pure Classic or pure ESM), the compiler applies aggressive Tree-Shaking / Dead Code Elimination (DCE) to entirely purge the esm-sw-detector logic from the resulting virtual chunk, guaranteeing zero overhead for standard applications.
  • Native TrustedScriptURL & CSP Compliance: Legacy virtual modules lacked flexibility when strict Content Security Policies were enforced during Service Worker registration. The new architecture introduces first-class support for TrustedScriptURL, including a highly flexible, custom callback option to safely resolve and sanitize the script URL before registration kicks in.

🚀 Features

  • 📖 Documentation & guides
  • 👌 Zero-Config: sensible built-in default configs for common use cases
  • 🔩 Extensible: expose the full ability to customize the behavior of the plugin
  • 🦾 Type Strong: written in TypeScript
  • 🔌 Offline Support: generate service worker with offline support (via Workbox)
  • ⚡ Fully tree shakable: client virtual modules are strictly optimized for Dead Code Elimination.
  • 📄 Web Manifest: auto-inject Web App Manifest and PWA assets seamlessly.
  • 💬 Prompt for new content: built-in support for Vanilla JavaScript, Vue 3, React, Svelte, SolidJS and Preact
  • ⚙️ Stale-while-revalidate: automatic reload when new content is available
  • ✨ Static assets handling: configure static assets for offline support
  • 🐞 Development Support: debug your custom service worker logic as you develop your application
  • 🔍 Inspector: visually inspect your resolved configuration, web manifest and service worker during development, via middleware or DevFrame
  • 🧩 Modular: use the ready-to-use plugins or compose your own integration from the building blocks in @unplugin-pwa/core and @unplugin-pwa/vite
  • 📦 Universal Bundlers: native integration with Vite, Rolldown, Webpack (WIP), Rspack (WIP), and Rsbuild (WIP).
  • 🛠️ Meta-Frameworks: seamless integration with îles, SvelteKit, VitePress, Astro, Nuxt 3/4/5, React Router, TanStack and Next (WIP).
  • 💥 PWA Assets Generator: generate all the PWA assets from a single command and a single source image
  • 🚀 PWA Assets Integration: serving, generating and injecting PWA Assets on the fly in your application

Warning

Work In Progress (WIP) While the Vite ecosystem and its associated meta-frameworks are fully operational, adapters for Webpack, Rspack, Rsbuild, and the Next.js integration are currently under active development. They are provided as previews and are not yet ready for production use.

🏗️ Architecture & Integrations

unplugin-pwa has evolved from a monolithic Vite plugin into a modular, framework-agnostic ecosystem.

If you are a framework maintainer, module author, or just curious about how the inner pieces fit together (Core, Builders, Client types, and Workbox), check out our comprehensive Architecture & Lifecycle Guide.

📄 License

MIT License © 2026-PRESENT Anthony Fu

Releases

Contributors

Languages