The course introduces the topic of using npm scripts as a build tool. It starts simple and then continue to build a small website as we introduce new topics.
By the end of the course, you’ll know how to get started and what tools and techniques are needed for you to create your own set of build scripts.
Topics:
- Create a basic
package.json
file - Run the basic npm scripts
- Create a custom npm script
- Run npm scripts in
series
- Run npm scripts in
parallel
- Use a shorthand syntax for running multiple npm scripts with
npm-run-all
- Run a set of similar npm scripts with a
wildcard
- Use
pre
andpost
npm script lifecycle hooks with test coverage - Pass arguments to npm scripts via
--
- Pipe data from one npm script to another with build-site scripts
- Run npm scripts when files change with
onchange
- Use package.json
variables
in npm scripts - Use custom config settings in your npm scripts
- Run npm scripts with git hooks using
husky
- Change the level of console output when running npm scripts
- Make npm scripts cross-environment friendly with
cross-env
,rimraf
,opn-cli
,cross-var
- List available npm scripts and support tab completion with
ntl
- Add comments to your npm scripts
- Pull out npm scripts into another file with
p-s
- Create a
bash script
to replace a complex npm script - Create a
node script
to replace a complex npm script