Gulp wrapper for custom Modernizr builds
JavaScript
Latest commit 2acbf3b Feb 10, 2015 @doctyper Update docs.
Permalink
Failed to load latest commit information.
test Initial commit. Jan 16, 2014
.gitignore Initial commit. Jan 16, 2014
.jshintrc Initial commit. Jan 16, 2014
.npmignore Initial commit. Jan 16, 2014
.travis.yml Add Travis config. Jan 16, 2014
README.md Update docs. Feb 10, 2015
index.js Make sure to return callback at every turn. Mar 31, 2014
package.json 1.0.0-alpha Feb 10, 2015

README.md

gulp-modernizr

Build Status

NPM

A Gulp wrapper for Modernizr.

Note: This plugin uses version 3 of Modernizr. Make sure to check the Github repo for the correct feature names (example: Modernizr.touch was renamed to Modernizr.touchevents).

Usage

First, install gulp-modernizr as a development dependency:

npm install --save-dev gulp-modernizr

Then, add it to your gulpfile.js:

var modernizr = require('gulp-modernizr');

gulp.task('modernizr', function() {
  gulp.src('./js/*.js')
    .pipe(modernizr())
    .pipe(gulp.dest("build/"))
});

API

modernizr(fileName)

fileName

Type: String

You can optionally pass a fileName to name the Modernizr file (defaults to 'modernizr.js')

gulp.src('./js/*.js')
  .pipe(modernizr('modernizr-custom.js'));

modernizr(/*fileName, */ settings)

settings

Type: Object

You can pass settings as an object. See the customizr repository for valid settings.

gulp.src('./js/*.js')
  .pipe(modernizr({
    excludeTests: ['csstransforms3d']
  }));

Available Settings

See the customizr repository for valid settings.

settings.uglify

Per the Gulp guidelines, the option to uglify the build goes against guidelines #1 and #3. Thus, this setting has been removed from this plugin. You may use gulp-uglify to achieve this functionality in Gulp:

gulp.src('./js/*.js')
  .pipe(modernizr())
  .pipe(uglify())
  .pipe(gulp.dest("build/"));

License

Copyright (c) 2013 Richard Herrera Licensed under the MIT license.