vite-plugin-pwa ships ten type-only entry points and no runtime for most of them
Zero-config PWA for Vite
At a glance
- What is it?
- This plugin makes a Vite build produce an installable, offline-capable web app with no configuration, using Workbox to generate the service worker. Its manifest is worth reading on its own: ten of its thirteen export paths exist only to carry TypeScript declarations. The other thing worth knowing is the Node floor, which the most recent release raised to 20.19.0.
- Who is it for?
- This plugin fits a Vite project that wants an installable web app with offline support and is willing to accept Workbox as the underlying service worker tool. It does not fit a project on an older Node or an older Vite, because the requirements have moved in steps and the page records each step.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 37 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- vite-pwa/vite-plugin-pwa4,312 ★ · +40
| Repository | 2026-09-23 | 2026-11-15 |
|---|---|---|
| vite-pwa/vite-plugin-pwa | 4.3k | 4.3k |
40 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Ten of eleven export paths exist only for types
The manifest's exports map is unusual and worth reading slowly.
The main entry is the only one with runtime behaviour. It has an import condition pointing at the ES module build with its declarations, and a require condition pointing at the CommonJS build with its declarations.
Then there is a types-only entry.
And then nine more entries, each with exactly one field: a types path pointing at a declaration file at the repository root.
"./react": {
"types": "./react.d.ts"
},
"./svelte": {
"types": "./svelte.d.ts"
},There are ones for Preact, React, SolidJS, Svelte, vanilla JavaScript and Vue, one for a client helper, one for an info helper, and one for the PWA assets.
So a project using React imports the main plugin and gets the same code, then separately imports from the React path to get typed helpers. That is why the tree has ten declaration files sitting at the top level next to the readme.
It also explains the fully tree-shakable claim in the feature list: there is very little runtime to shake, and the manifest declares no side effects.
The Node floor jumped two major versions in one release
The install section is four quoted lines about requirements and they are not in chronological order.
Reading from the top: from the current major version the plugin needs Node 20.19.0 or above. From an earlier version it needs Vite 5. From a version before that, Node 16 or above, with the reason given: the service worker library requires Node 16. And from a version before that, Vite 3.1 or above.
So the requirements have moved four times and the page keeps all four records.
That is useful, because a plugin this old has a long history of compatibility notes and a reader on any given toolchain needs to find their own line in it.
It is also why the current line is the one to check first. The newest release is the major version that raised the Node floor to a specific patch release rather than to a major line. That is the kind of requirement that catches people out, because a machine on Node 20 is not automatically on Node 20.19.
The install commands themselves are given three times over, once per package manager, all with the plugin added as a development dependency rather than a runtime one.
Framework support is listed twice and one list is longer
Two features in the list are about frameworks, and they describe different things.
One says there is built-in support for prompting the user when new content is available, and names six: Vanilla JavaScript, Vue 3, React, Svelte, SolidJS and Preact.
The other says the plugin integrates with six meta-frameworks, and names a different set: a newer JavaScript meta-framework, a full-stack framework, a documentation generator, a content-focused framework, a Vue meta-framework, and a full-stack React framework.
So twelve names across two features, and the two lists share nothing.
That is not padding. A component library and a meta-framework are different problems: one is where your components live in the build output, the other is where your routes and server rendering live. A plugin that supports both has to have a different integration for each.
The repository's examples follow the same split. There are per-framework examples for the component libraries, several of them wired to a router, and a separate SvelteKit example.
Zero-config means the defaults are a position, not an absence
The feature list claims sensible built-in defaults for common use cases and no configuration. Both halves are worth unpacking.
The zero-config half is a promise about the service worker. Generating one requires a build step, a precache manifest, and a set of runtime caching rules, and doing that by hand for a first project is a lot of ceremony. The plugin's default configuration supplies it.
The sensible defaults half is the part with opinions in it. A default precache strategy, a default navigation handling rule, and a default set of files to ignore are all choices about what your users download and what they see when they are offline.
That is why the plugin also advertises itself as extensible and as exposing the full ability to customize its behaviour. The same feature list that promises zero configuration promises complete override.
The fifth feature in the list names the mechanism the defaults are built on: service worker generation through Workbox.
Development support means debugging the worker, not the app
One feature is about your development loop and it is narrower than it sounds.
The claim is that you can debug your custom service worker logic while you develop your application.
That is a real problem. A service worker is a separate script with its own lifecycle, its own cache and its own registration, and by default it is invisible to the browser's normal debugging story.
The repository has three vanilla examples.
One is a vanilla example with a custom worker. One is a vanilla TypeScript example with development options turned on. And one is named vanilla-ts-no-ip.
One source image and one command for the icon set
Two features cover the part of a progressive web app that has nothing to do with code, and they are separated in a way that is worth understanding.
One is a generator: produce the whole set of progressive web app assets from a single source image with a single command.
The other is integration: serve, generate and inject those assets into your application as it runs.
The set of assets is not small. An installable web app needs icons at several sizes, a maskable icon for the platform's own shape, a browser shortcut icon, an Apple touch icon, and a manifest that names all of them. Producing those by hand is the step most people give up on.
So the generator exists to remove the manual work, and the integration exists so you do not have to copy generated files into your public directory yourself.
The repository has one example directory for the generator and the export map has a dedicated path for its types, which means the integration is a typed surface of its own rather than a set of options on the main plugin.
The documentation lives on its own host and the config lives in a file
Three of the features are really pointers to where the substance is, and that is a fair structure for a plugin with this many options.
The documentation and guides are a separate site on its own host, not a directory in the repository. There is a documentation directory in the tree as well, so both exist.
The full configuration is not in the readme at all. The readme points at a type declaration file for it, and at two external references: the web app manifest specification and the service worker library's own documentation.
That is an unusual choice and a defensible one. A type declaration is the configuration's real documentation, and keeping it in sync is something a compiler enforces. A readme table of options would drift.
It does mean the readme is short by design. It tells you the plugin exists, that the defaults work, that it is written in TypeScript, and that the full surface is somewhere else. The client type declarations for per-framework support are also pointed at as a file to read, not documented inline.
The readme's own length is the evidence: after the features and the install commands, it goes straight to the documentation link.
Editorial conclusion
This plugin fits a Vite project that wants an installable web app with offline support and is willing to accept Workbox as the underlying service worker tool. It does not fit a project on an older Node or an older Vite, because the requirements have moved in steps and the page records each step. Before you add it, check four things. Which Node you have, since the most recent release raised the floor substantially. Which Vite you have, since a previous step required a specific Vite generation. Which framework integration you need, because each one is a separate import path and only the main entry carries code. And whether you need push notifications, since the feature list does not mention them at all.
Frequently asked questions
How can I create a PWA in React using Vite?
Add the plugin to your Vite configuration file and it handles the rest with no further configuration, generating the service worker through Workbox and injecting the web app manifest. For React-specific typed helpers there is a separate import path that ships declarations only, alongside the main plugin entry.
How do I install vite-plugin-pwa?
Add it as a development dependency with your package manager; the page gives the npm, yarn and pnpm forms. From version 2.0.0 it requires Node 20.19.0 or above, and from version 0.17 it requires Vite 5. The plugin is then added to the plugins array of your Vite configuration.
Does vite-plugin-pwa support push notifications?
The README's feature list covers offline support, an update prompt, install and asset generation, and integrations with frameworks and meta-frameworks, and it does not mention push notifications anywhere.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/vite-pwa-vite-plugin-pwa)Star history chart for your README
[](https://hysenlabs.com/projects/vite-pwa-vite-plugin-pwa)Was this useful?