main-bower-min-checked

1.0.4 • Public • Published

main-bower-min-checked

Made to be used with Gulp. Get bower main files as default (defined in 'main') or minified file names array. If no minified version is found for some files, they will be created.

It uses main-bower-files to list bower dependencies, gulp-rename and gulp-uglify to create missing minified files.

Installation

  npm install --save-dev main-bower-min-checked

Example

var bower_files = require('main-bower-min-checked');
var inject = require('gulp-inject');

var main_bower_files_options = {
  includeDev: false,
  paths: {
    bowerDirectory: './lib',
    bowerJson: 'bower.json'
  }
};

var uglify_options = {
  preserveComments: 'all'
};
gulp.src('./index.html')
  .pipe(
    inject(
      gulp.src(
        bower_files(main_bower_files_options).getDefault(), 
        {read: false}
      )
    )
  )
  .pipe(gulp.dest('./'));
gulp.src('./index.html')
  .pipe(
    inject(
      gulp.src(
        bower_files(main_bower_files_options).getMinified(uglify_options), 
        {read: false}
      )
    )
  )
  .pipe(gulp.dest('./'));

Readme

Keywords

Package Sidebar

Install

npm i main-bower-min-checked

Weekly Downloads

3

Version

1.0.4

License

MIT

Last publish

Collaborators

  • seishin