As a front-end developer, you may notice that lately some folks are moving away from using build automation tools (task runners) such as Gulp or Grunt towards custom scripts and npm script runner. What is the reason for that?
You can slightly improve it by adding logging and error handling functionality:
Now you can list your script in package.json file as demonstrated below, and execute it with npm run build command.
The tools/build.js script will be converted to ES5 on the fly and executed by Node.js. No need to have any global dependencies installed to make it work (other than Node.js and npm).
BTW, in WebStorm IDE11 you can run the same command right from the UI:
For a complete example visit React Starter Kit on GitHub.
Published in #SWLH (Startups, Wanderlust, and Life Hacking)