1. 4

  2. 3

    In 2015 we dropped Grunt and Gulp in two projects I was leading in favour of npm scripts and that decision has worked out well for us. Both projects are for front-end applications with node api servers. We support live reloading in dev, pull down translations from transifex during builds, generate language-specific js bundles, and can build our native (Cordova) apps for iOS and Android all from our npm scripts. Everything you’d expect do to in any other build tool.

    What I prefer about plain npm scripts is that there’s no tool-specific gotchas or knowledge required to make improvements to our build system. Well, that’s not entirely true because we use Webpack for our front-end bundles. Aside from Webpack, then, if you can write node.js, you can add new build commands without having to wrap your head around the syntax for other build systems. This saves us some effort when onboarding new employees, and I like that I don’t have to keep going back to the Grunt or Gulp docs to figure out how to do something new.

    Another great plus for me is that we no longer have to install any npm packages globally, so it’s really easy for us to change Cordova versions between projects or testing new versions. Just git checkout and yarn install. The npm scripts can run Cordova commands as if it was installed globally, so we don’t have any issues from accidentally building our apps with the wrong version of Cordova anymore.