gulp-main-bower-files
Advanced tools
Comparing version 1.1.2 to 1.1.3
{ | ||
"name": "gulp-main-bower-files", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Use main-bower-files in a more gulp like way.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -30,2 +30,55 @@ # gulp-main-bower-files | ||
The parameters are passed on to [main-bower-files](https://www.npmjs.com/package/main-bower-files#usage). | ||
The parameters are passed on to [main-bower-files](https://www.npmjs.com/package/main-bower-files#usage). | ||
### Using the Gulp pipeline to minify the resulting JavaScript | ||
The following example produces minified output using [gulp-uglify](https://www.npmjs.com/package/gulp-uglify) | ||
```bash | ||
$ npm install --save-dev gulp-uglify | ||
``` | ||
```javascript | ||
var gulp = require('gulp'); | ||
var mainBowerFiles = require('gulp-main-bower-files'); | ||
var uglify = require('gulp-uglify'); | ||
gulp.task('uglify', function(){ | ||
return gulp.src('./bower.json') | ||
.pipe(mainBowerFiles( )) | ||
.pipe(uglify()) | ||
.pipe(gulp.dest('wwwroot/libs')); | ||
}); | ||
``` | ||
### Using the Gulp pipeline to use Bootstrap with jQuery and minify the resulting JavaScript | ||
```javascript | ||
var gulp = require('gulp'); | ||
var mainBowerFiles = require('gulp-main-bower-files'); | ||
var concat = require('gulp-concat'); | ||
var uglify = require('gulp-uglify'); | ||
var gulpFilter = require('gulp-filter'); | ||
gulp.task('main-bower-files', function() { | ||
var filterJS = gulpFilter('**/*.js'); | ||
return gulp.src('./bower.json') | ||
.pipe(mainBowerFiles({ | ||
overrides: { | ||
bootstrap: { | ||
main: [ | ||
'./dist/js/bootstrap.js', | ||
'./dist/css/*.min.*', | ||
'./dist/fonts/*.*' | ||
] | ||
} | ||
} | ||
})) | ||
.pipe(filterJS) | ||
.pipe(concat('vendor.js')) | ||
.pipe(uglify()) | ||
.pipe(filterJS.restore()) | ||
.pipe(gulp.dest('./wwwroot/libs')); | ||
}); | ||
``` |
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
84
9864
16
137