# gulp-modernizr-build

> A gulp.js plugin to crawl your files and build the minimum features into modernizr

Latest version **0.0.6** (published 2018-04-13) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install gulp-modernizr-build
pnpm add gulp-modernizr-build
yarn add gulp-modernizr-build
bun add gulp-modernizr-build
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2018-04-13 |
| First published | 2017-04-07 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.9.0 |
| Dependencies | 6 |
| Unpacked size | 16.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | madlandproject |
| Keywords | gulpplugin, gulp, modernizr |

## Links

- npm: https://www.npmjs.com/package/gulp-modernizr-build
- Repository: https://github.com/madlandproject/gulp-modernizr-build
- Homepage: https://github.com/madlandproject/gulp-modernizr-build#readme
- Issues: https://github.com/madlandproject/gulp-modernizr-build/issues
- npm.io page: https://npm.io/package/gulp-modernizr-build

## Dependencies (6)

- [vinyl](https://npm.io/package/vinyl.md) ^2.1.0
- [through2](https://npm.io/package/through2.md) ^2.0.3
- [fancy-log](https://npm.io/package/fancy-log.md) ^1.3.2
- [modernizr](https://npm.io/package/modernizr.md) ^3.6.0
- [ansi-colors](https://npm.io/package/ansi-colors.md) ^1.1.0
- [lodash.defaults](https://npm.io/package/lodash.defaults.md) ^4.2.0

## Recent versions

- 0.0.6 (latest) — 2018-04-13
- 0.0.5 — 2017-06-22
- 0.0.4 — 2017-04-27
- 0.0.3 — 2017-04-13
- 0.0.2 — 2017-04-07

## README

Gulp Modernizr Build
====================
> Build custom Modernizr.js file 

## Description ##
Build Modernizr with Gulp. This plugin scans input files for references to Modernizr feature detects (only on the `Modernizr` object in JS and only on a `html` element selector in CSS) and builds a custom Modernizr build with only the necessary detections.

## Install ##

Install the plugin with NPM:
`npm install --save gulp-modernizr-build`

Require it in your gulpfile:

`const modernizr = require('gulp-modernizr-build')`


## Usage ##

```javascript

gulp.src([ 
    './**/*.js',
    './**/*.css',
    '!./**/modernizr*.js']) // Don't forget to exclude any other Modernizr files you may have in your sources.
    .pipe( modernizr('modernizr.js', {
        cssPrefix   : 'feat-'
    })
    .pipe( uglify() ); // this plugin won't do it for  you.

```

## Config
The plugin function accepts two parameters: The file name and a config object with the following properties:

- `cssPrefix`
    
    Prefix for CSS classes applied to the `<html />` element

- `quiet`
    
    Supress console output
    
- `addFeatures`
    
    An array of feature path to manually add to the build. for example : `es6/promises`
        
## Testing
Testing is done with Mocha and Chai : 

`npm test`

## Contributors
Thank you to following people for contributing to this plugin.

- Danielle McLean ([@00dani](https://github.com/00dani))
- KasperAndersson ([@KasperAndersson](https://github.com/KasperAndersson))

## Changelog
- **0.0.6** - Updated Modernizr to v3.6. Updated Chai to version 4. Removed gulp-util dependency per the gulp team recommendation for Gulp 4. Added warning when no features are detected. Now Logs all additional options. Added tests for console output. Handled possible unhandled Promise rejection.
- **0.0.5** - Updated Modernizr to v3.5. setClasses option is set to true by default. addFeatures option allows adding features manually.
- **0.0.4** - Added LESS and Stylus file extensions for CSS detection. added quiet option. Added basic tests.
- **0.0.3** - Bug fixes for RegExp objects (#1, #2). Updated README.
- **0.0.2** - Removed unwanted files from NPM.
- **0.0.1** - The plugin was born.

## Todo ##
- Accept an `allFeatures` parameter to build every available feature detection. Useful for building dev versions of Modernizr.
- Add .editorconfig file & lintconfig for consistency
- Tests

    * Include references to every feature in JS and CSS to check they are detected correctly
    * Test for false positives with sub-features (video & videoautoplay for example)

- Better documentation.
- Generate compatibility report based on [CanIUse](https://github.com/ben-eb/caniuse-lite) support and [Browserslist](https://github.com/ai/browserslist).

---
_Source: https://npm.io/package/gulp-modernizr-build · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
