Build automation using the npm run
command, which runs tasks defined in the scripts field in package.json
. Learn more
Advantages:
- adequate for simple projects
- minimal setup, dependencies come with
npm install
- use any shell script, not just NodeJS packages or plugins
npm install
Pulls down dependencies defined in the devDependencies field in package.json
.
npm test
Runs test.js with TAP. Shortcut for tap test.js
npm run build-css
Compiles css/*.less
into CSS files, then concatenates css/*.css
into dist/styles.css
.
This example project uses Less for brevity (Less comes with npm install
). Other pre-processors may be used.
npm run dev
Watches for changes to css/*.less
files then runs npm run build-css