3 ms·
Chrome extension build steps. Because the chrome manifest requires an actual file, you can’t rely on a dev server and hot module reloading. So I’ve hacked vites
by purple-leafy 3y ago
Chrome extension build steps. Because the chrome manifest requires an actual file, you can’t rely on a dev server and hot module reloading. So I’ve hacked vites build command and watch command to constantly recompile chrome extension code as I develop it (typescript + frontend frameworks etc).
Add to the fact that you have to manually reload the unpacked chrome extension to apply your new changes, so I’ve hooked solution 1 up with a web socket server and a custom chrome extension that watches all your other extensions and talks to the web socket server to auto reload an unpacked extension anytime the build step completes
It’s a nightmare hack, but I may just be the worlds most productive chrome extension builder as a result! I’ve released 5 extensions in the last 5 months :)
About to release a big one, but it’s also probably the words most complicated chrome extension (LLM + Firebase store + Stripe + Auth + Serverless functions)
- lambdaba 3y agoSounds very cool. Do you have plans to open source that?
- yokuze 3y agoHere’s a project that does HMR and more: https://wxt.dev/ https://wxt.dev/
- purple-leafy 3y agoI haven’t used it but I think I was put off by the fact that updating your manifest restarts the browser My custom workflow handles everything for me, I never need to restart the browser of anything like that
- purple-leafy 3y agoI think I should but it’s currently a private repo, here’s the current Vite plug-in: https://www.npmjs.com/package/vite-plugin-extension-reloader https://www.npmjs.com/package/vite-plugin-extension-reloader The extension is of the same name