VI

Vite Plugin Pwa

vite-plugin-pwa

Zero-config PWA for Vite

Utilities
react
pwa
vue
vitepress
preact
svelte
sveltekit
workbox
solidjs
vite
Stars
4.3k
Weekly
3.4M
Open issues
191
Bundle
~25 kB

Installation

npm install vite-plugin-pwa

Code example

import { useVitePluginPwa } from "vite-plugin-pwa";

export function Example() {
  const value = useVitePluginPwa();
  return <p>{String(value)}</p>;
}

Pros & cons

Pros

  • Actively maintained by antfu
  • 3.4M weekly downloads. Battle tested
  • First-class TypeScript definitions
  • MIT licensed

Considerations

  • Adds roughly ~25 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 191 open issues on GitHub

FAQs

Alternatives & similar libraries