npm run once again

It can’t be left unnoticed today, how more and more developers go «back to the roots» and leave Grunt and Gulp environment in favour of npm scripts.

Just take a look at these great articles!

I can’t say I’ve totally ditched Gulp (can’t say the same about Grunt though…), but npm scripts can be seen more often in my everyday work. How the hell did it happen? I’ve tried to analyze the situation, but it made no sense until today. Now I exactly know.

The reason was pretty obvious and robust — Webpack (and I know I’m not alone). Have you tried to work with it using task runner?

This guy here -> https://www.npmjs.com/package/gulp-webpack

Well you shouldn’t (don’t repeat my mistakes), it’s a waste of time and overcomplexity in your code. It is way more convenient to work with CLI commands, that can be easily replaced with npm scripts shortcuts.

`webpack-dev-server — content-base public` => `npm run serve`

`NODE_ENV=production webpack -p` => `npm run build`

I guess… npm scripts is my cup of tea eventually.