4 ms·
I never got what's so great about Grunt in the first place, and instead stuck to makefiles. Something like `cat src/*.js | uglify > build.js` would take me a lo
by Jean-Philipe 11y ago
I never got what's so great about Grunt in the first place, and instead stuck to makefiles. Something like `cat src/*.js | uglify > build.js` would take me a lot more effort to do with Grunt (or Gulp).
- CraigJPerry 11y agoYou old curmudgeon you... ;-) Make has it's foibles - before we talk about those we need to declare are we talking gmake, nmake, BSD make etc. - our build scripts can break in the wrong make. And how will windows users collaborate (they'll install cygwin). Etc etc All that said though, I still find make to be lower barrier to entry. If I need to start a watcher or something, I generally have that in my npm package.json but there's nothing stopping me having a make target to call npm start or whatever. I forced myself to learn enough gulp to be dangerous (incidentally I see strong parallels between grunt / maven and gulp / gradle) and the faux pipes implementation is clearly influenced by make, it's just far more clunky an implementation. So it could just be I'm wired up wrongly but I have to agree, neither grunt nor gulp moved the needle meaningfully. Counter arguments like it's all one language don't hold much water for me, or for the designer who only really knows css. I'm resigned to being labeled a curmudgeon in this one!
- foldr 11y agoI had reservations about using make for node builds until I got berated by another curmudgeon on here, who kindly showed me all the tricks necessary to implement the rules I needed. I'm very very happy I switched to make. I think part of the issue is that I (and I suspect many others) though I knew basically how make works, except that I had no idea about % patterns, the patsubst function, etc.
- onion2k 11y agoWith gulp; var gulp = require('gulp'), concat = require('gulp-concat'), uglify = require('gulp-uglify'); gulp.task('js', function(){ return gulp.src(['src/**/*.js']) .pipe(concat('build.js')) .pipe(uglify()) .pipe(gulp.dest('.')); }); gulp.task('default', ['js']); With grunt; module.exports = function (grunt) { grunt.initConfig({ concat: { js: { files: {'build.js': 'src/**/*.js' } } }, uglify: { bundle: { files: {'build.min.js': 'bundle.js'} } } }); The bash script is easier for such a trivial job. Gulp and Grunt aren't better if that's all you're doing. They come in to their own when you have a large number of tasks to run. But even then, if you (and your team) prefer make then it's better to use make.
- douche 11y agoIt does seem overly complicated, for what ends up usually being not much more than a makefile or even a simple batch script. We haven't quite come out of the cycle where everything that we already had has to be half-implemented a dozen times in JavaScript/Node...
- pcr0 11y agoIf that's all you want to do (concat, minify, convert es6/sass), then by all means, I do agree make is the simpler albeit slightly less maintainable and non-cross-platform solution. I use make for my quick static sites too. But when you need more features like bundle splitting (app code and libraries live in separate files, for caching), cache-busting, lazy-loading, separate configs for production and development, etc. make doesn't quite cut it IMO.
- Jean-Philipe 11y agoSure, cross-platform (read: supports also Windows) is a big plus for grunt, gulp and the likes.