Hacker News new | ask | show | jobs
by cfu28 1475 days ago
This is neat. How does live-reloading work? Manually reloading a chrome extension with each code change has been a pain point for me in the past.
1 comments

Thanks! We wrote a custom Parcel runtime [1] inspired by Parcel's HMR runtime (which was too bloated and buggy for us) that injects a web socket listener into the development build of the extension.

Whenever a bundle change happens, Parcel sends it the refresh message and it either does `chrome.runtime.reload()` or `location.reload()` depending on the context.

[1]: https://github.com/PlasmoHQ/plasmo/blob/main/packages/parcel...