A Vite plugin for hot-reloading Chrome extensions during development. Current stable version is 1.0.4, released on an as-needed cadence. It establishes a WebSocket connection to notify the extension to reload when file changes are detected, similar to HMR for web apps. Unlike generic HMR plugins, it specifically handles extension manifests and content scripts. Requires setting `build.emptyOutDir` to `false` and providing a manifest file path. Lightweight alternative to manual extension reloading or using browser-specific tools.
npm install vite-plugin-crx-hot-reloadVerified import paths — ran on the pinned version, not inferred.
Basic setup: import the plugin, provide manifest path, and disable emptyOutDir for development.
Add `build: { emptyOutDir: false }` to your Vite config.Refresh the extension page manually after the first change to content_scripts.
Change the port using `crxHotReload({ port: 8182, input: '...' })`.Use Vite as your build tool.
Run `pnpm add -D vite-plugin-crx-hot-reload` and ensure import is as shown.
Verify plugin is added to Vite config and port is available. Try changing port via options.
Replace `const crxHotReload = require(...)` with `import crxHotReload from 'vite-plugin-crx-hot-reload'`.