Run npm scripts when files change with onchange

InstructorElijah Manor

Share this video with your friends

Send Tweet

In this lesson we will look at how we can setup our npm scripts to execute when the file system has changed. Some common examples of this are automatically linting your code, running unit tests, or using a pre-processor for your CSS.

Victor
Victor
~ 8 years ago

If you are on windows, use double quotes:

"scripts": {
  "watch": "onchange \"**/*.js\" -- npm run build:js"
}
Elijah Manor
Elijah Manor(instructor)
~ 8 years ago

Yes, this is shown in lesson 16