antfu/vite-plugin-pwa ↗
Created Jan 29, 2021 · View the antfu/vite-plugin-pwa repository page
Zero-config PWA for Vite
Want this for your repo?
Render a free sample of any GitHub repo in seconds.
Contributors
11
Lines of Code
156
From
Aug 25, 2020
To
Jan 26, 2021
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.
