vite-patcher (v0.0.8) is a CLI tool that automates injection of Vite plugins and configuration code into your vite.config.* file. It reads the existing config, adds necessary imports and plugin initializations, and preserves formatting. It currently supports the 'pwa' patch for vite-plugin-pwa and has built-in detection for vike to avoid double injection. Developed actively on GitHub under node-ecosystem.
npm install vite-patcherNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs vite-patcher and vite-plugin-pwa, then uses the CLI to automate adding PWA support to a Vite+vike project.
Use npx, yarn dlx, or pnpm dlx to run the command.
Manually check https://vite-plugin-pwa.netlify.app/ for the latest API.
Only use vite-patcher in Vite projects.
Backup your vite config before running the tool.
Run 'npm install -D vite-patcher' in your project root, or use npx.
Run 'npm install vite' in your project.
Run 'npm install vite-plugin-pwa' before using the pwa patch.