I recently read this article on Medium. I was wondering if anyone here uses npm scripts for task automation instead of gulp/grunt. What are your thoughts/opinions on this?
I don't use NPM as a build tool (I use grunt for the product I work on and gulp for a few private projects), but it does seem interesting. If I were to use something other than the standard gulp/grunt build, though, I think I would opt for using Make. The reasons, and a brief intro, are outlined pretty well in an article by the folks at segment.io.
Yes. Here's a link to an amazing article that does a beautiful job of highlighting the "how" part of it: blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-…
I use a rather simple build process for my custom projects:
Gulp for builds; I usually have the following tasks generally
concat - Concatenate all the files; produce a combined file. Useful for development. compile - compile all the source filesclean - do a clean up; delete all the temp. filesprod - make a production ready file; Uglify, and such.Add a NPM script for this
npm compile - compile everything (I add flags for production or development)npm test - Oh, come on!However, I have also used some complicated build frameworks. I remember, I was working for this team, and we had a Makefile. It was used to compile some of our native plugins. We had around 50 tasks defined. Why? Because we wrote the library on which the entire infrastructure depended. Close to 10000 tests. :\
So, yeah! "It's complicated" (Sorry, I couldn't resist it)
Denny Trebbin
Lead Fullstack Developer. Experimenting with bleeding-edge tech. Irregularly DJ. Hobby drone pilot. Amateur photographer.
Using fly.js github.com/bucaran/fly Just using npm scripts to avoid global installations.