1.8.2 • Published 4 years ago

gulp-main-bower-files v1.8.2

Weekly downloads
1,903
License
MIT
Repository
github
Last release
4 years ago

gulp-main-bower-files

================

Greenkeeper badge

npm version npm downloads Dependency Status Build Status codecov.io

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

Usage

var 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 JavaScript

The 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 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', { 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'));
});
1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

5 years ago

1.7.2

5 years ago

1.7.1

5 years ago

1.7.0

7 years ago

1.6.3

7 years ago

1.6.2

8 years ago

1.6.1

9 years ago

1.6.0

9 years ago

1.5.4

9 years ago

1.5.3

9 years ago

1.5.2

9 years ago

1.5.1

9 years ago

1.5.0

9 years ago

1.4.0

9 years ago

1.3.1

9 years ago

1.3.0

10 years ago

1.2.5

10 years ago

1.2.4

10 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago