天天看點

[NPM] Run npm scripts when files change with onchange

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.

Install:

For example, you want to watch all the js file and scss file, to check the tests and lints.

For lints:

And for tests: