VI

Vite Plugin Pwa

vite-plugin-pwa

Zero-config PWA for Vite

Utilities
react
pwa
vue
vitepress
preact
svelte
sveltekit
workbox
solidjs
vite
Stars
602
Weekly
4.2M
Open issues
8
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
  • 4.2M 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
  • 8 open issues on GitHub

FAQs

Alternatives & similar libraries