Skip to content

Commit

Permalink
Add some comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
discojonathan committed Jan 7, 2015
1 parent 16119c1 commit 58ec182
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ module.exports.assets = function (opts) {

searchPaths = files[name].searchPaths || opts.searchPath;

// If searchPaths is not an array, use brace-expansion to expand it into an array
if (!Array.isArray(searchPaths)) {
searchPaths = expand(searchPaths);
}

// Get relative file paths and join with search paths to send to vinyl-fs
globs = filepaths
.filter(isRelativeUrl)
.map(function (filepath) {
Expand All @@ -97,16 +99,20 @@ module.exports.assets = function (opts) {
}
});

// Flatten nested array before giving it to vinyl-fs
src = vfs.src(_.flatten(globs), {
base: file.base,
nosort: true,
nonull: true
});

// If any external streams were included, pipe all files to them first
streams.forEach(function (stream) {
src.pipe(stream);
});

// Add assets to the stream
// If noconcat option is false, concat the files first.
src
.pipe(gulpif(!opts.noconcat, concat(name)))
.pipe(through.obj(function (newFile, enc, callback) {
Expand Down

0 comments on commit 58ec182

Please sign in to comment.