News for hackers. Stuff that matters.
Re:Grunt 1.0.0 released by onion2k on Tuesday April 05, 2016 @07:01AM (#11429406)
With 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.

There are no comments on this comment yet.