Watchify is a tool that automatically rebuilds your code when any monitored files change. To use it with your project, follow these steps:
- Install Watchify globally with
npm install -g watchify
. - In your project directory, create a
watch
script in yourpackage.json
:
"scripts": {
"watch": "watchify script.js -o bundle.js"
}