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
~ 7 years ago

If you are on windows, use double quotes:

"scripts": {
  "watch": "onchange \"**/*.js\" -- npm run build:js"
}
Elijah Manorinstructor
~ 7 years ago

Yes, this is shown in lesson 16