Watches for file changes in your extension's directory. When a change is detected, it reloads the extension and refreshes the active tab (to re-trigger the updated scripts).
Here's a blog post explaining it (thanks to KingOfNothing for the translation).
- Works by checking timestamps of files
- Supports nested directories
- Automatically disables itself in production
-
Drop
hot-reload.jsto your extension's directory. -
Put the following into your
manifest.jsonfile:
"background": { "scripts": ["hot-reload.js"] }Also, you can simply clone this repository and use it as a boilerplate for your extension.
-
See xpl#5 (a feedback needed)
-
Make it
importable from the NPM module, as it's suggested here. I think arequirewould work now, as it executes the script, but not sure about theimport... May need to tweak code a little bit.