gulp-concat-multi

Gulp plugin to concatenate multiple sets of files

Usage no npm install needed!

<script type="module">
  import gulpConcatMulti from 'https://cdn.skypack.dev/gulp-concat-multi';
</script>

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.