npm scripts
are low-level and leverage the actual library you want to use (example:"lint": "eslint ./"
)package.json
is a central place to see what scripts are available (alsonpm run
will list all scripts)- When things get too complicated you can always defer to another file (example:
"complex-script": "babel-node tools/complex-script.js"
) npm scripts
are more powerful than one might first think (pre/post hooks, passing arguments, config variables, chaining, piping, etc...)- We aren't tied to a specific build abstraction (Anvil, brocolli, Grunt, Gulp) when the next big thing comes out.
- Not everyone is familiar with
npm scripts
- Some scripts can get lengthy and cumbersome
npm-run-all
: A CLI tool to run multiple npm-scripts in parallel or sequential.rimraf
: A deep deletion module for node (likerm -rf
)onchange
: Use glob patterns to watch file sets and run a command when anything is added, changed or deleted.
- There are lots of Gulp plugins and utilities
- We already have some helper libraries to provide common Gulp tasks
- Gulp plugins often get out of date and don’t support new features from the underlying library
- You become dependant on the Gulp plugin author and not the library that is being wrapped
- Documentation for Gulp plugins are typically not very robust or comprehensive
- Debugging a Gulp plugin can be frustrating. Is the problem in the plugin or in the underlying library?
- If a plugin doesn't exist already for Gulp you need to write it yourself
- Errors that occur inside a Gulp wrapper arean't always handled very well
- Do we switch to
npm scripts
only, keep using Gulp, or have a mixture of the two? - If we have a mixture of
npm scripts
and Gulp, how do we decide when to use what? Do we start with an assumption ofnpm scripts
until a certain complexity threshold is met? Do we only usenpm scripts
for new projects and then split out totools/script-file.js
when the complexity gets high? (See react-slingshot for an example) - How do we reconcile projects that have Gulp already in them? Do we keep updating them or do we consider switching them to
npm scripts
if we find we keep updating them?
@JacobLett you can start from here
https://medium.com/@dabit3/introduction-to-using-npm-as-a-build-tool-b41076f488b0#.2qy24g5nt