Created
December 14, 2014 18:20
-
-
Save sudodoki/c772340145fb4ef65fe1 to your computer and use it in GitHub Desktop.
Adds a list of files in resulting concatenated file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var concat = require('gulp-concat-util'); | |
var through = require('through'); | |
var gutil = require('gulp-util'); | |
var refObj = {wallOfText: ''}; | |
function write(file) { | |
refObj.wallOfText += "/* " + file.path + " */" + gutil.linefeed; | |
this.emit('data', file); | |
} | |
function end() { | |
this.emit('end'); | |
} | |
gulp.task('scripts', function() { | |
gulp.src('./src/*.js') | |
.pipe(through(write, end)) | |
.pipe(concat('all.js')) | |
.pipe(concat.header('/* Files concatenated for this file:*/\n<%= refObj.wallOfText %>\n', {refObj: refObj})) | |
.pipe(gulp.dest('./dist/')) | |
}); | |
gulp.task('default', ['scripts']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instead of full path, you can have it to be relative, just use
path.relative