PWA integrations for Vite and the ecosystem
⚠️ IMPORTANT: This project is not yet ready for production. This project will not release anything. Its contents will be moved to the corresponding packages at the Vite PWA organization.
This is a Work-in-Progress fork of Google Workbox, currently under heavy development. APIs may change, documentation is incomplete, and some features may be broken. Please do not use this in production environments yet.
# Install dependencies – must use pnpm for workspace lockfile
pnpm install --frozen-lockfile
# Build all packages
nr build
# Run all tests
nr test:ci
Requires pnpm 11.10.0 (see
packageManager)After the initial install, you can use
@antfu/nishortcuts:nifor install,nrfor running scripts. However, always usepnpm install --frozen-lockfilefor the initial setup to respect the lockfile.
This monorepo is for testing all integrations and the Workbox fork.
| Package | Description |
|---|---|
| @composable-vite-pwa/unplugin-pwa | Main plugin – Vite + Webpack adapters, virtual modules, framework hooks. |
| @composable-vite-pwa/workbox-build | Build‑time SW generation (globs assets, injects manifests, bundles the SW). |
| @composable-vite-pwa/workbox-swkit | Runtime library that runs inside the SW (precaching, routing, strategies, expiration, etc.). |
| @composable-vite-pwa/workbox-window | Client‑side SW registration + lifecycle helper. |
| @composable-vite-pwa/workbox-cli | CLI for running Workbox strategies. |
| @composable-vite-pwa/nuxt | Nuxt module. |
| @composable-vite-pwa/astro | Astro integration. |
| @composable-vite-pwa/react-router | React Router integration. |
| @composable-vite-pwa/sveltekit | SvelteKit integration. |
| @composable-vite-pwa/tanstack | TanStack Start integration. |
| @composable-vite-pwa/vitepress | VitePress integration. |
We are really excited that you are interested in contributing to this project! Before submitting your contribution, please make sure to take a moment and read through the following guide.
This repository is a monorepo using pnpm workspaces. The package manager used to install and link dependencies must be pnpm.
corepack enable.git checkout -b my-new-branch
pnpm install --frozen-lockfile
After this, you can use
ni(install) andnr(run) from@antfu/nifor convenience.
nr build
📌 Example status:
- All
unplugin-pwa-*examples should work, as well as the webpack and rspack ones.- For
unplugin-pwa-nuxtexamples: allpwa-assetsandnuxt5examples requires--frozenwhen runningni --frozenorpnpm install --frozen-lockfilefrom inside the example directory. If there is apnpm-lock.yamlinside the example, you need to install dependencies after building all the packages from root.
The repository includes a set of examples (in the examples/ folder) where you can test your changes.
Note: Some examples may rely on local packages. Make sure you’ve built the packages first (
nr build) from root.
To test a specific example:
cd examples/<example-name>
nr dev # or nr build, depending on the example
# Run all tests (CI mode)
nr test:ci
# Run tests in watch mode (skips heavy bundler integration tests)
nr test
# Typecheck all packages
nr test:typecheck
nr lint
nr lint:fix # apply safe fixes
main branch with a clear description of the changes and the problem they solve.