1.3.1 • Published 6 years ago

gulp-concat-folders v1.3.1

Weekly downloads
22
License
MIT
Repository
github
Last release
6 years ago

Build Status

gulp-concat-folders

Gulp plugin that lets you work with folders and treat them as package names

Install

yarn add --dev gulp-concat-folders

Rationale

This gives you a perfect solution to build different packages out of folders. Given this structure:

path
  to
    folder
	  main
	    jquery.js
		ember.js
	  secondary
	    plugin.js

it is very easy to build

dist
  folder
    main.js
	secondary.js

Usage

let gulp = require('gulp');
let path = require('path');
let concatFolders = require('gulp-concat-folders');
let pathToFolder = 'path/to/folder';

gulp.task('task', done => {
	/*
    This will concat files present in the first level folders from the base
    folder provided as argument. If no base folder is provided, pwd will be
    used. This plugin returns a stream of vynil files, so you can safely
    pipe it to other plugins.
  */

	return gulp.src(path.join(pathToFolder, '**/*'))
		.pipe(concatFolders(pathToFolder))
		.pipe(gulp.dest('dist'));
}));