github.com/antfu/vite-plugin-pwa ↗
Zero-config PWA for Vite
Open this visualization on its own page →
Contributors
11
Lines of Code
156
From
2020-08-25
To
2021-01-26
About antfu/vite-plugin-pwa
Vite-plugin-pwa is a zero-config plugin that transforms Vite-based applications into progressive web apps. It handles service worker generation with offline support through Workbox, automatically creates and injects web app manifests, and provides built-in prompt functionality for notifying users when new content is available. The plugin is framework-agnostic and includes native support for Vue 3, React, Svelte, SolidJS, and Preact, with integration available for meta-frameworks like SvelteKit, Nuxt 3, Astro, and VitePress.
The plugin is fully typed in TypeScript and designed for extensibility despite its zero-config defaults. It handles static asset caching, supports the stale-while-revalidate strategy for automatic content revalidation, and includes a dedicated PWA assets generator that creates all necessary icons and images from a single source image. Development features allow debugging of custom service worker logic in real-time, and the entire codebase is tree-shakable to minimize bundle impact.
Built and maintained by Anthony Fu, the project targets developers building modern web applications with Vite who want PWA capabilities without complex manual configuration. It requires Vite 5 and Node 16 or above, with comprehensive documentation available to guide users through setup and customization options.