在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mauricedb/gulp-main-bower-files开源软件地址(OpenSource Url):https://github.com/mauricedb/gulp-main-bower-files开源编程语言(OpenSource Language):JavaScript 99.8%开源软件介绍(OpenSource Introduction):gulp-main-bower-files================ Use main-bower-files in a more gulp like way. Use the bower.json file as the source and it will create a vinyl stream for each of the files main-bower-files return when parsing the bower.json. Installation$ npm install gulp-main-bower-files --save-dev Usagevar gulp = require('gulp');
var mainBowerFiles = require('gulp-main-bower-files');
gulp.task('main-bower-files', function() {
return gulp.src('./bower.json')
.pipe(mainBowerFiles([[filter, ]options][, callback]))
.pipe(gulp.dest('./wwwroot/libs'));
}); The parameters are passed on to main-bower-files. Using the Gulp pipeline to minify the resulting JavaScriptThe following example produces minified output using gulp-uglify $ npm install --save-dev gulp-uglify 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 JavaScriptvar 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', { restore: true });
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'));
}); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论