gulp-main-bower-files
Advanced tools
Comparing version 1.2.2 to 1.2.3
{ | ||
"name": "gulp-main-bower-files", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Use main-bower-files in a more gulp like way.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -67,3 +67,3 @@ # gulp-main-bower-files | ||
gulp.task('main-bower-files', function() { | ||
var filterJS = gulpFilter('**/*.js'); | ||
var filterJS = gulpFilter('**/*.js', { restore: true }); | ||
return gulp.src('./bower.json') | ||
@@ -84,5 +84,5 @@ .pipe(mainBowerFiles({ | ||
.pipe(uglify()) | ||
.pipe(filterJS.restore()) | ||
.pipe(filterJS.restore) | ||
.pipe(gulp.dest('./wwwroot/libs')); | ||
}); | ||
``` |
@@ -43,2 +43,12 @@ /** | ||
it('can process multiple dependencies via a callback function', function (done) { | ||
gulp.src(__dirname + '/no-bowerrc/bower-simple-multi.json') | ||
.pipe(mainBowerFiles(function (err, files) { | ||
assert.equal(err, null); | ||
assert.equal(files.length, 3); | ||
})) | ||
.pipe(streamAssert.length(3)) | ||
.pipe(streamAssert.end(done)); | ||
}); | ||
it('can process multiple dependencies with includeSelf', function (done) { | ||
@@ -51,2 +61,12 @@ gulp.src(__dirname + '/no-bowerrc/bower-simple-multi.json') | ||
it('can override main files with filter with a callback', function (done) { | ||
gulp.src(__dirname + '/no-bowerrc/bower-simple-multi.json') | ||
.pipe(mainBowerFiles('**/*.*', function (err, files) { | ||
assert.equal(err, null); | ||
assert.equal(files.length, 3); | ||
})) | ||
.pipe(streamAssert.length(3)) | ||
.pipe(streamAssert.end(done)); | ||
}); | ||
it('can override main files with filter', function (done) { | ||
@@ -65,2 +85,18 @@ gulp.src(__dirname + '/no-bowerrc/bower-simple-multi.json') | ||
it('can load main files with callback function', function (done) { | ||
gulp.src(__dirname + '/no-bowerrc/bower-simple-multi.json') | ||
.pipe(mainBowerFiles({ | ||
overrides: { | ||
multi: { | ||
main: ['*.js', '*.css'] | ||
} | ||
} | ||
}, function(err, files){ | ||
assert.equal(err, null); | ||
assert.equal(files.length, 4); | ||
})) | ||
.pipe(streamAssert.length(4)) | ||
.pipe(streamAssert.end(done)); | ||
}); | ||
it('can override main files without filter', function (done) { | ||
@@ -67,0 +103,0 @@ gulp.src(__dirname + '/no-bowerrc/bower-simple-multi.json') |
Sorry, the diff of this file is not supported yet
263
56475