gulp-concat-multi

Gulp plugin to concatenate multiple sets of files

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
gulp-concat-multi
201.0.16 years ago7 years agoMinified + gzip package size for gulp-concat-multi in KB

Readme

gulp-concat-mutli
A wrapper around gulp-concat that allows you to define multiple sets of files, which each combine into their own unique file.

Installation

You know how we do.
npm install gulp-concat-multi --save

Usage

gulp-concat-multi is used in place of gulp.src(). It concatenates your sets of files and then returns a stream of the combined files for you to mess with further.
var concat = require('gulp-concat-multi');

function scripts() {
  concat({
    'vendor.js': 'js/vendor/**/*.js',
    'app.js': ['js/lib/**/*.js', 'js/app.js']
  })
    .pipe(uglify())
    .pipe(gulp.dest('dist/js'));
}

Any options supported by gulp-concat can be passed as the second parameter.
function scripts() {
  var opts = { newLine: ';' };

  concat({
    'vendor.js': 'js/vendor/**/*.js',
    'app.js': ['js/lib/**/*.js', 'js/app.js']
  }, opts)
    .pipe(uglify())
    .pipe(gulp.dest('dist/js'));
}

No source map support at the moment.