Git Product home page Git Product logo

gulp-modernizr's Introduction

Modernizr

Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.

npm version Build Status codecov Inline docs

Modernizr tests which native CSS3 and HTML5 features are available in the current UA and makes the results available to you in two ways: as properties on a global Modernizr object, and as classes on the <html> element. This information allows you to progressively enhance your pages with a granular level of control over the experience.

Breaking changes with v4

  • Dropped support for node versions <= 10, please upgrade to at least version 12

  • Following tests got renamed:

    • class to es6class to keep in line with the rest of the es-tests
  • Following tests got moved in subdirectories:

    • cookies, indexeddb, indexedblob, quota-management-api, userdata moved into the storage subdirectory
    • audio moved into the audio subdirectory
    • battery moved into the battery subdirectory
    • canvas, canvastext moved into the canvas subdirectory
    • customevent, eventlistener, forcetouch, hashchange, pointerevents, proximity moved into the event subdirectory
    • exiforientation moved into the image subdirectory
    • capture, fileinput, fileinputdirectory, formatattribute, input, inputnumber-l10n, inputsearchevent, inputtypes, placeholder, requestautocomplete, validation moved into the input subdirectory
    • svg moved into the svg subdirectory
    • webgl moved into the webgl subdirectory
  • Following tests got removed:

    • touchevents: discussion
    • unicode: discussion
    • templatestrings: duplicate of the es6 detect stringtemplate
    • contains: duplicate of the es6 detect es6string
    • datalistelem: A dupe of Modernizr.input.list

New Asynchronous Event Listeners

Often times people want to know when an asynchronous test is done so they can allow their application to react to it. In the past, you've had to rely on watching properties or <html> classes. Only events on asynchronous tests are supported. Synchronous tests should be handled synchronously to improve speed and to maintain consistency.

The new API looks like this:

// Listen to a test, give it a callback
Modernizr.on("testname", function (result) {
  if (result) {
    console.log("The test passed!");
  } else {
    console.log("The test failed!");
  }
});

We guarantee that we'll only invoke your function once (per time that you call on). We are currently not exposing a method for exposing the trigger functionality. Instead, if you'd like to have control over async tests, use the src/addTest feature, and any test that you set will automatically expose and trigger the on functionality.

Getting Started

  • Clone or download the repository
  • Install project dependencies with npm install

Building Modernizr

From javascript

Modernizr can be used programmatically via npm:

var modernizr = require("modernizr");

A build method is exposed for generating custom Modernizr builds. Example:

var modernizr = require("modernizr");

modernizr.build({}, function (result) {
  console.log(result); // the build
});

The first parameter takes a JSON object of options and feature-detects to include. See lib/config-all.json for all available options.

The second parameter is a function invoked on task completion.

From the command-line

We also provide a command line interface for building modernizr. To see all available options run:

./bin/modernizr

Or to generate everything in 'config-all.json' run this with npm:

npm start
//outputs to ./dist/modernizr-build.js

Testing Modernizr

To execute the tests using mocha-headless-chrome on the console run:

npm test

You can also run tests in the browser of your choice with this command:

npm run serve-gh-pages

and navigating to these two URLs:

http://localhost:8080/test/unit.html
http://localhost:8080/test/integration.html

Code of Conduct

This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.

License

MIT License

gulp-modernizr's People

Contributors

backflip avatar dependabot[bot] avatar doctyper avatar greenkeeper[bot] avatar mxl avatar nlemoine avatar rejas avatar thedancingcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gulp-modernizr's Issues

adding customTests leads to ENOENT: no such file or directory

I keep getting an error that my customTests file doesn't exist:

[15:18:03] Starting 'modernizr'...
[15:18:03] Finished 'modernizr' after 9.83 ms

>> Explicitly including these tests:
>> touchevents

Looking for Modernizr references

>> Ready to build using these settings:
>> addTest, html5printshiv, testProp, fnBind

Building your customized Modernizr{ [Error: Error: ENOENT: no such file or directory, open '/Users/user/Sites/project/web/themes/project/node_modules/modernizr/lib/../src/test/../../../../../js/utils/modernizrVideoAutoplay.js'
In module tree:
    modernizr-init

    at Error (native)
]
  originalError: 
   { [Error: ENOENT: no such file or directory, open '/Users/user/Sites/project/web/themes/project/node_modules/modernizr/lib/../src/test/../../../../../js/utils/modernizrVideoAutoplay.js']
     errno: -2,
     code: 'ENOENT',
     syscall: 'open',
     path: '/Users/user/Sites/project/web/themes/project/node_modules/modernizr/lib/../src/test/../../../../../js/utils/modernizrVideoAutoplay.js',
     fileName: '/Users/user/Sites/project/web/themes/project/node_modules/modernizr/lib/../src/test/../../../../../js/utils/modernizrVideoAutoplay.js',
     moduleTree: [ 'modernizr-init' ] } }

There is no folder src/test inside modernizr.

Here is the relevant part in my gulpfile.js:

gulp.task('modernizr', function() {
  gulp.src('./js/*.js')
    .pipe(modernizr({
      'tests' : ['touchevents'],
      'customTests': ['./js/utils/modernizrVideoAutoplay.js']
    }))
    .pipe(gulp.dest(path.modernizr.dist))
});

setclasses() not being applied

I'm finding that when using gulp-modernizr to generate my modernizr.js for touchevents, i'm getting a pretty different output than when I do it on the Modernizr site (and as far as I can tell doesn't behave the same).

diff here: https://www.diffchecker.com/2nsmhxj3

Notably the gulp-modernizr doesn't have the setClasses() at the end. If I manually add that it works as expected. Is this a bug or am I doing something wrong?

Thanks!

Task "finishes" before it's actually done

In the console output with the example code I get "Finished 'modernizr' after x ms", then all my various other tasks (some of which list the modernizr task as a dependency) finish, and then I see the "Looking for Modernizr references" and the other output.

This doesn't work for me: I need the modernizr file to be written before some of the other tasks run.

Am I doing something wrong, or is this a bug?

Unable to install on windows 10

Hello, I'm trying to install gulp-modernizr on Windows 10 and it's not working.
I'm able to install all other kind of dependencies that I needed (more than 80), i'm not sure what is causing this but here is my log:

$ npm install --save-dev gulp-modernizr
npm WARN deprecated [email protected]: use [cross-spawn](https://github.com/IndigoUnited/node-cross-spawn) or [cross-spawn-async](https://github.com/IndigoUnited/node-cross-spawn-async) instead.
-
> [email protected] postinstall D:\Sync\QQ\web\node_modules\gulp-modernizr\node_modules\customizr
> node scripts/postinstall.js

--------------------------------------------------------------------------------------------------------------------------------------------
This postinstall script is a workaround for npm issue #1341: npm install should recursively check/install dependencies
More info can be found here: https://github.com/npm/npm/issues/1341
Checking for any missing Modernizr dependencies in path: D:\Sync\QQ\web\node_modules\gulp-modernizr\node_modules\customizr\node_modules\modernizr
--------------------------------------------------------------------------------------------------------------------------------------------

npm WARN invalid config access=undefined
npm WARN invalid config https-proxy=undefined
npm WARN invalid config Must be a full url with 'http://'
npm WARN invalid config init-author-url=undefined
npm WARN invalid config Must be a full url with 'http://'
npm WARN invalid config proxy=undefined
npm WARN invalid config Must be a full url with 'http://'
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\node.exe" "D:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "prefix" "-g"
npm ERR! node v4.2.6
npm ERR! npm  v2.14.12
npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module 'undefined'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\node.exe" "D:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "prefix" "-g"
npm ERR! node v4.2.6
npm ERR! npm  v2.14.12

npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Sync\QQ\web\node_modules\gulp-modernizr\node_modules\customizr\node_modules\modernizr\npm-debug.log
npm WARN invalid config access=undefined
npm WARN invalid config https-proxy=undefined
npm WARN invalid config Must be a full url with 'http://'
npm WARN invalid config init-author-url=undefined
npm WARN invalid config Must be a full url with 'http://'
npm WARN invalid config proxy=undefined
npm WARN invalid config Must be a full url with 'http://'
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Cedrik\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! node v4.2.6
npm ERR! npm  v2.9.0
npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module 'undefined'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Cedrik\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! node v4.2.6
npm ERR! npm  v2.9.0

npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Sync\QQ\web\node_modules\gulp-modernizr\node_modules\customizr\node_modules\modernizr\npm-debug.log
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\node.exe" "D:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev" "gulp-modernizr"
npm ERR! node v4.2.6
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `node scripts/postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/postinstall.js'.
npm ERR! This is most likely a problem with the customizr package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/postinstall.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls customizr
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Sync\QQ\web\npm-debug.log

Hope It can be solved, and thank you 😃

NPM modules not found

I see the following log when running this task:

[gulp] Running 'modernizr'...

Looking for Modernizr references

>> Ready to build using these settings:
>> setClasses, addTest, html5printshiv, testProp, fnBind

Building your customized Modernizr>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-saucelabs" not found. Is it installed?
>> Local Npm module "grunt-contrib-qunit" not found. Is it installed?
>> Local Npm module "grunt-contrib-nodeunit" not found. Is it installed?
.......OK
[gulp] Finished 'modernizr' in 2.12 s

Where do those NPM module dependencies come from?

"Looking for Modernizr references" error

I'm trying to use gulp-modernizr, but without success... Following the instructions, I installed it via npm (referencing the git repo, as descibed in #2) and put in my gulpfile.js:

gulp.task('modernizr', function() {
    gulp.src('[path]/js/*.js')
        .pipe(modernizr())
        .pipe(gulp.dest([path])); // In README this line is wrong, just "dest()"
});

But I'm always getting this error (trying watch or run directly with gulp modernizr):

Looking for Modernizr references

[...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:242
                        throw error;
                              ^
TypeError: Cannot read property 'length' of undefined
    at Object.parseCodeFromBuffers ([...]/node_modules/gulp-modernizr/node_modules/customizr/src/crawler.js:152:27)
    at Object.init ([...]/node_modules/gulp-modernizr/node_modules/customizr/src/crawler.js:241:18)
    at next ([...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:584:17)
    at notify ([...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:201:22)
    at Deferred.then.promise.then ([...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:262:4)
    at Object.exports.when ([...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:364:20)
    at next ([...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:584:12)
    at Object.exports.seq ([...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:592:2)
    at Object.Customizr.init ([...]/node_modules/gulp-modernizr/node_modules/customizr/src/index.js:26:12)
    at Object.Customizr ([...]/node_modules/gulp-modernizr/node_modules/customizr/src/index.js:16:15)

In which point I'm writing wrong code?

Regards!

An in-range update of eslint is breaking the build 🚨

The devDependency eslint was updated from 5.15.3 to 5.16.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v5.16.0
  • dfef227 Build: gensite passes rulesMeta to formatter rendering (#11567) (Kevin Partington)
  • c06d38c Fix: Allow HTML formatter to handle no meta data (#11566) (Ilya Volodin)
  • 87a5c03 Docs: func-style: clarify when allowArrowFunctions is used (#11548) (Oliver Joseph Ash)
  • bc3e427 Update: pass rule meta to formatters RFC 10 (#11551) (Chris Meyer)
  • b452f27 Chore: Update README to pull in reviewer data (#11506) (Nicholas C. Zakas)
  • afe3d25 Upgrade: Bump js-yaml dependency to fix Denial of Service vulnerability (#11550) (Vernon de Goede)
  • 4fe7eb7 Chore: use nyc instead of istanbul (#11532) (Toru Nagashima)
  • f16af43 Chore: fix formatters/table test (#11534) (Toru Nagashima)
  • 78358a8 Docs: fix duplicate punctuation in CLI docs (#11528) (Teddy Katz)
Commits

The new version differs by 11 commits.

  • ded2f94 5.16.0
  • ea36e13 Build: changelog update for 5.16.0
  • dfef227 Build: gensite passes rulesMeta to formatter rendering (#11567)
  • c06d38c Fix: Allow HTML formatter to handle no meta data (#11566)
  • 87a5c03 Docs: func-style: clarify when allowArrowFunctions is used (#11548)
  • bc3e427 Update: pass rule meta to formatters RFC 10 (#11551)
  • b452f27 Chore: Update README to pull in reviewer data (#11506)
  • afe3d25 Upgrade: Bump js-yaml dependency to fix Denial of Service vulnerability (#11550)
  • 4fe7eb7 Chore: use nyc instead of istanbul (#11532)
  • f16af43 Chore: fix formatters/table test (#11534)
  • 78358a8 Docs: fix duplicate punctuation in CLI docs (#11528)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Template literals

For some reason, I cannot use:

return gulp.src(`${paths.scripts.src}/*.js}`)

I am using the same template literal setup to return the Sass source which works as expected.

An in-range update of mocha is breaking the build 🚨

The devDependency mocha was updated from 6.0.2 to 6.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v6.1.0

6.1.0 / 2019-04-07

🔒 Security Fixes

  • #3845: Update dependency "js-yaml" to v3.13.0 per npm security advisory (@plroebuck)

🎉 Enhancements

  • #3766: Make reporter constructor support optional options parameter (@plroebuck)
  • #3760: Add support for config files with .jsonc extension (@sstephant)

📠 Deprecations

These are soft-deprecated, and will emit a warning upon use. Support will be removed in (likely) the next major version of Mocha:

🐛 Fixes

  • #3829: Use cwd-relative pathname to load config file (@plroebuck)
  • #3745: Fix async calls of this.skip() in "before each" hooks (@juergba)
  • #3669: Enable --allow-uncaught for uncaught exceptions thrown inside hooks (@givanse)

and some regressions:

📖 Documentation

🔩 Other

  • #3830: Replace dependency "findup-sync" with "find-up" for faster startup (@cspotcode)
  • #3799: Update devDependencies to fix many npm vulnerabilities (@XhmikosR)
Commits

The new version differs by 28 commits.

  • f4fc95a Release v6.1.0
  • bd29dbd update CHANGELOG for v6.1.0 [ci skip]
  • aaf2b72 Use cwd-relative pathname to load config file (#3829)
  • b079d24 upgrade deps as per npm audit fix; closes #3854
  • e87c689 Deprecate this.skip() for "after all" hooks (#3719)
  • 81cfa90 Copy Suite property "root" when cloning; closes #3847 (#3848)
  • 8aa2fc4 Fix issue 3714, hide pound icon showing on hover header on docs page (#3850)
  • 586bf78 Update JS-YAML to address security issue (#3845)
  • d1024a3 Update doc examples "tests.html" (#3811)
  • 1d570e0 Delete "/docs/example/chai.js"
  • ade8b90 runner.js: "self.test" undefined in Browser (#3835)
  • 0098147 Replace findup-sync with find-up for faster startup (#3830)
  • d5ba121 Remove "package" flag from sample config file because it can only be passes as CLI arg (#3793)
  • a3089ad update package-lock
  • 75430ec Upgrade yargs-parser dependency to avoid loading 2 copies of yargs

There are 28 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

regularly seg faulting

I'm running the gulp-webserver module with gulp-watch, as well. For some reason, when I run the modernizr task, it seg faults and all processes (server/watcher) stop. This happens about 80% of the time, unless i run the modernizr task separately and cache it (which I can't do if I also have a clean task). The output of the modernizr task, regardless of when the task is run, is sent to stdout after all gulp tasks have finished, and the segfault happens during what seems to be the actual build (the "Building your customized Modernizr" block). Here's the end of the typical output:

...

>> Ready to build using these settings:
>> setClasses, addTest, html5printshiv, testProp, fnBind

Building your customized Modernizr>> Local Npm module "grunt-contrib-connect" not f
ound. Is it installed?
>> Local Npm module "grunt-saucelabs" not found. Is it installed?
>> Local Npm module "grunt-contrib-qunit" not found. Is it installed?
>> Local Npm module "grunt-contrib-nodeunit" not found. Is it installed?
..Segmentation fault: 11

when it works, the build completes, and instead of the two dots and "Segmentation fault" message, it says, as you know, ..........OK.

My gulp modernizr task is simply (in its own commonjs module):

var gulp = require('gulp'),
    modernizr = require('gulp-modernizr'),
    sources = require('./sources');

module.exports = (function() {
  gulp.task('modernizr', function() {
    gulp.src(sources.scripts.concat(sources.scss))
        .pipe(modernizr({
          cache: true,
          dest: './build/js/modernizr.js',
          quiet: true
        }));
  });
})();

If I remove the server and watch tasks but keep the modernizr task, I still segfault most of the time. Every so often I might get a seg fault with the gulp-sass task, but that's pretty rare. It really seems like this is the culprit. Can anyone shed a little bit of light as to why this might happen in this task, and what can be done about it?

Thank you, and let me know if you need any more information.

some bug with merge stream

Error:
------------------/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:242
throw error;
^
Error in plugin 'gulp-modernizr'
No data returned

My code:

gulp.task('modernizr', function () {
    var getDirectories = function (config) {
        var directories = [];
        parts.forEach(function (part) {
            options.part = part;
            directories.push({
                src: config.src.map(function (item) {
                    return template(item, options);
                }),
                dest: template(config.dest, options)
            });
        });
        return directories;
    };

    var directories = getDirectories({
        src: [
            '<%= paths.build[part].css %>/**/*.css',
            '<%= paths.build[part].js %>/**/*.js'
        ],
        dest: '<%= paths.build[part].componentsJs %>'
    });

    var tasks = directories.map(function (directory) {
        return gulp.src(directory.src)
            .pipe(plugins.modernizr(
                'modernizr/modernizr.js',
                {
                    options: [
                        'setClasses',
                        'addTest',
                        'testProp',
                        'fnBind'
                    ],
                    excludeTests: [
                        'hidden'
                    ]
                }
            ))
            //directory.dest
            .pipe(gulp.dest(directory.dest));
    });

    return merge(tasks);
});

npm install fails in postinstall.js

I'm unable to install this package as it fails as below:

12244 info install [email protected]
12245 info postinstall [email protected]
12246 verbose unsafe-perm in lifecycle true
12247 info [email protected] Failed to exec postinstall script
12248 verbose unlock done using C:\Users\Admin\AppData\Roaming\npm-cache_locks\customizr-87ff1bcc5d05333b.lock for D:\Devzone\InstallersCache\InstallersCache\node_modules\gulp-modernizr\node_modules\customizr
12249 verbose about to build D:\Devzone\InstallersCache\InstallersCache\node_modules\gulp-modernizr
12250 verbose unlock done using C:\Users\Admin\AppData\Roaming\npm-cache_locks\gulp-modernizr-32c9da1f744e76b7.lock for D:\Devzone\InstallersCache\InstallersCache\node_modules\gulp-modernizr
12251 verbose stack Error: [email protected] postinstall: node scripts/postinstall.js
12251 verbose stack Exit status 1
12251 verbose stack at EventEmitter. (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\lifecycle.js:214:16)
12251 verbose stack at emitTwo (events.js:87:13)
12251 verbose stack at EventEmitter.emit (events.js:172:7)
12251 verbose stack at ChildProcess. (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
12251 verbose stack at emitTwo (events.js:87:13)
12251 verbose stack at ChildProcess.emit (events.js:172:7)
12251 verbose stack at maybeClose (internal/child_process.js:818:16)
12251 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
12252 verbose pkgid [email protected]
12253 verbose cwd D:\Devzone\InstallersCache\InstallersCache
12254 error Windows_NT 6.2.9200
12255 error argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "gulp-modernizr" "--save-dev"
12256 error node v4.2.1
12257 error npm v2.14.7
12258 error code ELIFECYCLE
12259 error [email protected] postinstall: node scripts/postinstall.js
12259 error Exit status 1
12260 error Failed at the [email protected] postinstall script 'node scripts/postinstall.js'.
12260 error This is most likely a problem with the customizr package,
12260 error not with npm itself.
12260 error Tell the author that this fails on your system:
12260 error node scripts/postinstall.js
12260 error You can get their info via:
12260 error npm owner ls customizr
12260 error There is likely additional logging output above.
12261 verbose exit [ 1, true ]
12262 verbose unbuild node_modules\gulp-modernizr\node_modules\customizr
12263 info preuninstall [email protected]
12264 info uninstall [email protected]
12265 verbose unbuild rmStuff [email protected] from D:\Devzone\InstallersCache\InstallersCache\node_modules

touchevents + ES6

Probably I am doing something wrong, but I am new to ES6 ....

I want to use the touchevents options in a project where i am generating a custom modernizr js file trough this gulp plugin.

here my code:

---------------------------------
GULP TASK:
gulp.task('modernizr', () => {
// check the js files
return gulp.src([
folderSrc/**/*.js,
])
// custom options
.pipe(modernizr({
'options' : [
'setClasses',
'addTest',
'testProp',
'fnBind',
],
// Define any tests you want to explicitly include : HERE my problem?
'feature-detects': [
'touchevents',
],
}))
// generate a custom JS file
.pipe(gulp.dest(
fileDist.js,
));
});

---------------------------------
GULP IMPLEMENTATION:
// call the modernizr JS file as a module
import Modernizr from 'modernizr';

// try to check if we have the touchevenets. HERE value is UNDEFINED
console.info(Modernizr.touchevents);

At this step I have the 'touchevents' classes appended to the html tag, and modernizr works.
But the console log in the js for the touch events return undefined.

probably i made a mistake in the task configuration. but i have no idea..

Help please :)

Any of of 'requirejs' breaks build.

If any other module uses the requirejs api after gulp-modernizr is imported, eg:

var requirejs = require('requirejs');
requirejs.optimize({
     mainConfigFile: config.js + '/bootstrap.js',
     out: 'app.js',
     name: 'foo'
}, function(err) {
  if (err) {
    console.log(err);
  }
  console.log("Done");
});

Or, for example, using https://github.com/jlouns/gulp-requirejs-optimize ...

Then the build will fail like this:

Looking for Modernizr references

>> 1 match in /Users/doug/dev/empty-coop/foo/static/build/stylesheets/_manifest.css
>> svg

>> 1 match in /Users/doug/dev/empty-coop/foo/static/build/stylesheets/styles-nomq.css
>> svg

>> 1 match in /Users/doug/dev/empty-coop/foo/static/build/stylesheets/styles.css
>> svg

>> Ready to build using these settings:
>>

Building your customized ModernizrGenerate in call: undefined
undefined
TAP version 13
not ok 1 - TypeError: generate is not a function
  ---
  at:
    line: 69
    column: 25
    file: node_modules/modernizr/lib/build.js
    function: build
  stack: >
    build (node_modules/modernizr/lib/build.js:69:25)

    Object.build (node_modules/modernizr/lib/build.js:162:50)

    Object.init (node_modules/customizr/src/builder.js:101:14)

    next (node_modules/promised-io/promise.js:584:17)

    notify (node_modules/promised-io/promise.js:201:22)

    notifyAll (node_modules/promised-io/promise.js:180:5)

    [object Object].Deferred.resolve.callback.emitSuccess
    (node_modules/promised-io/promise.js:223:3)

    [object Object]._onTimeout (node_modules/customizr/src/crawler.js:250:22)

  test: TAP
  message: 'TypeError: generate is not a function'
  source: |
    'modernizr-init': generate(config)
  ...
1..1
# failed 1 of 1 tests
# time=3426.104ms

This is because https://github.com/Modernizr/Modernizr/blob/master/lib/build.js#L154 fails to resolve anything, presumably because requirejs is initialized when the gulp-modernizr package is initially imported, and then somehow screwed up when something uses it.

I don't have any solution to this other than, 'Don't use anything that uses requirejs in your build', but I thought I'd report this here (even though technically the problem is in modernizr, not gulp-modernizr), so that frustrated folks could find it easily.

yarn warnings

I'm getting these when installing via yarn. May be of interest.

warning gulp-modernizr > customizr > glob > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp-modernizr > customizr > [email protected]: use [cross-spawn](https://github.com/IndigoUnited/node-cross-spawn) or [cross-spawn-async](https://github.com/IndigoUnited/node-cross-spawn-async) instead.

gulp task doesn't properly return

Specifying a Modernizr task as dependency for a different task casues the main task to never start.

The Modernizr tasks exits with 8 instead of the expected 0.

Gulpfile.js:

...

gulp.task('scripts', ['modernizr'], function() {
  return gulp.src(['src/js/**/*.js', '!src/js/vendor/**'])
    .pipe(plugins.plumber())
    .pipe(plugins.concat(pkg.name + '.application.js'))
    .pipe(plugins.jshint())
    .pipe(plugins.jshint.reporter('default'))
    .pipe(plugins.uglify())
    .pipe(gulp.dest('../static/js'));
});

gulp.task('modernizr', function() {
  return gulp.src(['src/js/**/*.js', 'src/less/' + pkg.name + '.styles.less'])
    .pipe(plugins.plumber())
    .pipe(plugins.modernizr(pkg.name + '.modernizr.js'))
    .pipe(gulp.dest('../static/js'));
});

...

Console output:

➜  Gulp git:(develop) ✗ gulp scripts
[gulp] Using gulpfile /Users/Guido/Projects/vanGogh/src/VanGogh.Web/Gulp/gulpfile.js
[gulp] Starting 'modernizr'...

Looking for Modernizr references

>> Ready to build using these settings:
>> setClasses, addTest, html5printshiv, testProp, fnBind

Building your customized Modernizr>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-saucelabs" not found. Is it installed?
>> Local Npm module "grunt-contrib-qunit" not found. Is it installed?
>> Local Npm module "grunt-contrib-nodeunit" not found. Is it installed?
.........OK
➜  Gulp git:(develop) ✗

includeTests rather than excludeTests?

The fact this is using Modernizr 3.0 is great. However, version 3 has had 99 new features tests added and by the looks of it the team is looking to add more in future. Would it make more sense to be able to include the feature tests you need? Rather than having a very long list of excluded feature tests you don't need?

Gulp modernizr doesn't add css classes

I'm using gulp-modernizr
This is config:

gulp.task('modernizr', function() {
  gulp.src(['dev/scripts/*.js', 'dev/styles/**/*.css'])
  // gulp.src('dev/scripts/modernizr-config.json')
    .pipe(modernizr(
      {
        "minify": false,
        "options": [
          "setClasses"
        ],
        "tests": [
          "test/json",
          "test/svg",
          "test/css/backgroundsize",
          "test/css/calc",
          "test/css/flexbox",
          "test/css/flexboxlegacy",
          "test/css/flexboxtweener",
          "test/css/flexwrap",
          "test/css/mediaqueries",
          "test/storage/localstorage",
          "test/svg/clippaths",
          "test/svg/foreignobject",
          "test/svg/inline"
        ]
      }
    ))
    .pipe(gulpif(argv.production, uglify(), rename({suffix: '.min'})))
    .pipe(gulp.dest("prod/scripts/"))
}); 

this is log:

Looking for Modernizr references

>> 4 matches in e:\WWW\MATRIX\dev\scripts\modernizr-custom.js
>> flexbox, flexwrap, supports, svg

>> 2 matches in e:\WWW\MATRIX\dev\scripts\myscripts.js
>> flexboxlegacy, localstorage
[15:00:49] Finished 'jshint' after 2.54 s

>> Ready to build using these settings:
>> setClasses

But I can't see css prefixes in my HTML

<!doctype html><html lang="en">...

I also tried to use modernizr cli with this command

E:\WWW\MATRIX>modernizr E:\WWW\MATRIX\dev\scripts\modernizr-config.json

modernizr-config.json is in the same folder with modernizr-custom.js

In this case I had this message

'window' is not defined Code: 800A1391 E:\WWW\MATRIX\modernizr.js

It's possibly concerned to the first issue.

Windows - Error: Tried loading "src/generate.js"

Hi,

I've tried to run my gulp-modernizr task on Windows. I got the error.
On Linux/Mac task working normally.

C:\project>gulp modernizr
[06:07:25] Using gulpfile C:\project\gulpfile.js
[06:07:25] Starting 'modernizr'...
C:\project\node_modules\gulp-modernizr\node_modules\custom
izr\node_modules\modernizr\node_modules\requirejs\bin\r.js:2559
                    throw err;
                          ^
Error: Tried loading "src/generate.js" at src/generate.js then tried node's require("src/generate.js") and it failed with error: Error: Cannot find module 'src/generate.js'
    at C:\project\node_modules\gulp-modernizr\node_modules\customizr\node_modules\modernizr\node_modules\requirejs\bin\r.js:2552:27
    at Object.context.execCb (C:\project\node_modules\gulp-modernizr\node_modules\customizr\node_modules\modernizr\node_modules\requirejs\bin\r.js:1916:33)
    at Object.Module.check (C:\project\node_modules\gulp-modernizr\node_modules\customizr\node_modules\modernizr\node_modules\requirejs\bin\r.js:1125:51)
    at Object.Module.enable (C:\project\node_modules\gulp-modernizr\node_modules\customizr\node_modules\modernizr\node_modules\requirejs\bin\r.js:1409:22)
    at Object.context.enable (C:\project\node_modules\gulp-modernizr\node_modules\customizr\node_modules\modernizr\node_modules\requirejs\bin\r.js:1777:39)
    at Function.req.get (C:\project\node_modules\gulp-modernizr\node_modules\customizr\node_modules\modernizr\node_modules\requirejs\bin\r.js:2476:33)
    at Object.localRequire [as require] (C:\project\node_modules\gulp-modernizr\node_modules\customizr\node_modules\modernizr\node_modules\requirejs\bin\r.js:1650:40)
    at requirejs (C:\project\node_modules\gulp-modernizr\node_modules\customizr\node_modules\modernizr\node_modules\requirejs\bin\r.js:2003:24)
    at Object.<anonymous> (C:\project\node_modules\gulp-modernizr\node_modules\customizr\node_modules\modernizr\lib\build.js:123:18)
    at Module._compile (module.js:460:26)

C:\project>

Task:

gulp.task( 'modernizr', function () {
  return gulp.src( ['path/to/*.css', 'path/to/*js'] )
    .pipe( $.modernizr( 'modernizr-build.js', {
      options : [
        'setClasses'
      ]
    } ) )
    .pipe( gulp.dest( paths.scripts.dist ) );
});

Windows 7 32bit
NodeJS 0.10 - 0.12

Dependency versions:

├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├── [email protected]
│ │ │   └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ ├── [email protected]
│ │ │   │ └── [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ ├── [email protected]
│ │ │   │ └─┬ [email protected]
│ │ │   │   ├── [email protected]
│ │ │   │   └── [email protected]
│ │ │   ├── [email protected]
│ │ │   └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └─┬ [email protected]
│ │ │     ├── [email protected]
│ │ │     ├── [email protected]
│ │ │     ├── [email protected]
│ │ │     └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│   └─┬ [email protected]
│     └── [email protected]

Use Modernizr without gulp.src

Hi,

Why must I add src of some JS files before use modernizr ? Can I use modernizr directly ?

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

Thanks for help

Sometimes it works, sometimes it doesn't

Sometimes my gulp task will prematurely exit when I have gulp-modernizr included:

var gulp = require('gulp');
var addsrc = require('gulp-add-src');
var concat = require("gulp-concat");
var gulpMerge = require('gulp-merge');
var gulpif = require('gulp-if');
var modernizr = require('gulp-modernizr');
var ngAnnotate = require('gulp-ng-annotate');
var rewriteCSS = require('gulp-rewrite-css');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var templateCache = require('gulp-angular-templatecache');
var uglify = require('gulp-uglify');
var watch = require('gulp-watch');


var doUglify = true;
var dest = './assets/dist';


function jsSrcs(){
    return gulpMerge(
        gulp.src([
            './assets/bower-libs/jquery/dist/jquery.js',
            './assets/bower-libs/angular/angular.js',
            './assets/bower-libs/angular-recaptcha/release/angular-recaptcha.js',
            './assets/bower-libs/angular-route/angular-route.js',
            './assets/bower-libs/isotope/dist/isotope.pkgd.js',
            './assets/bower-libs/isotope-packery/packery-mode.pkgd.js',
            './assets/bower-libs/querystring/querystring.js'
        ]),
        gulp.src('./assets/js/**/*.tpl.html').pipe(templateCache({root: '/js/', standalone: true})).pipe(concat('templates.js')),
        gulp.src([
            './assets/js/**/*.js'
        ])
    );
}


gulp.task('js', function() {
  return gulpMerge(jsSrcs().pipe(modernizr({tests: ['videoautoplay']}))).add(jsSrcs())
    .pipe(sourcemaps.init())
    .pipe(concat('bundle.min.js'))
    .pipe(gulpif(doUglify, ngAnnotate()))
    .pipe(gulpif(doUglify, uglify()))
    .pipe(sourcemaps.write('./'))
    .pipe(gulp.dest(dest));
});

Command output:

$ gulp js
(node:89371) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[10:44:03] Using gulpfile ~/dev/project/gulpfile.js
[10:44:03] Starting 'js'...

>> Explicitly including these tests:
>> videoautoplay

Looking for Modernizr references

>> Ready to build using these settings:
>> addTest, html5printshiv, testProp, fnBind

Building your customized Modernizr...OK

If successful, after that last line there should be something like:

[10:42:59] Finished 'js' after 2.0 s

uglify is not working

Passing the uglify: true or uglify: false or not passing the uglify flag at all has no effect on the output. The modernizr build is always output as unminified, with the following header:

/* Build http://modernizr.com/download/#-shiv-dontmin */

Supported version

It says in the documentation that version 3 is supported. Just wondering if you support patch versions under 3, specifically 3.5 which adds support for grid detection.

If not is there any chance that this would be something that would be on the cards in the near future?

Scanning css files

Is it possible to scan for Modernizr references in css files and build a custom Modernizr based on those?

Community Test won't be added

I've tried to add community tests to my build, but they're ignored:

gulp.task 'modernizr', ->
  gulp.src dir.base + 'scripts/main.coffee'
    .pipe modernizr
      crawl: false
      uglify: true
      tests : [
        'cssanimations'
        'csstransforms'
        'csstransforms3d'
        'csstransitions'
        'css-vhunit'
        'css-vmaxunit'
        'css-vminunit'
        'css-vwunit' 
        'css-calc'
        'flexbox'
        'touch'
      ]
    .on('error', notify.onError(
      title: 'gulp [modernizr]'
      message: 'Error: <%= error.message %>'))
    .pipe gulp.dest dir.dist

Gulp Modernizr installation problems.

I know this sounds like a duplicate of #2, but it's different.

I've installed through git, which went smooth:
npm install --save-dev git://github.com/doctyper/gulp-modernizr.git

But running gulp-modernizr gave me the following output:

Looking for Modernizr references

>> Ready to build using these settings:
>> setClasses, addTest, html5printshiv, testProp, fnBind

Building your customized Modernizr>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-saucelabs" not found. Is it installed?
>> Local Npm module "grunt-contrib-qunit" not found. Is it installed?
>> Local Npm module "grunt-contrib-nodeunit" not found. Is it installed?

Why is it looking for Grunt plugins?

EDIT:
My bad, just found out it's a duplicate of #3. The task never finishes though...

Multiple stream error

If i have two stream with modernizr, i get error:

Error in plugin 'gulp-modernizr'
No data returned
    at /home/admin/web/default.dev.itgalaxy.company/public_html/node_modules/gulp-modernizr/index.js:81:33
    at Object.Customizr.finalize (/home/admin/web/default.dev.itgalaxy.company/public_html/node_modules/gulp-modernizr/node_modules/customizr/src/index.js:50:39)
    at next (/home/admin/web/default.dev.itgalaxy.company/public_html/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:584:17)
    at notify (/home/admin/web/default.dev.itgalaxy.company/public_html/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:201:22)
    at notifyAll (/home/admin/web/default.dev.itgalaxy.company/public_html/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:180:5)
    at Deferred.resolve.callback.emitSuccess (/home/admin/web/default.dev.itgalaxy.company/public_html/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:223:3)
    at Object.<anonymous> (/home/admin/web/default.dev.itgalaxy.company/public_html/node_modules/gulp-modernizr/node_modules/customizr/src/builder.js:126:21)
    at ChildProcess.<anonymous> (/home/admin/web/default.dev.itgalaxy.company/public_html/node_modules/gulp-modernizr/node_modules/customizr/node_modules/modernizr/lib/build.js:78:7)
    at ChildProcess.emit (events.js:98:17)
    at Process.ChildProcess._handle.onexit (child_process.js:809:12)

https://github.com/gulpjs/gulp/blob/master/docs/recipes/using-multiple-sources-in-one-task.md

npm module missing?

When I run gulp modernizr I get the following output:

$ gulp modernizr
[gulp] Using gulpfile ~/Sites/test/gulpfile.js
[gulp] Starting 'modernizr'...
[gulp] Finished 'modernizr' after 6.38 ms

Looking for Modernizr references

>> 1 match in ~/Sites/test/style.css
>> svg

>> Ready to build using these settings:
>> setClasses, addTest, html5printshiv, testProp, fnBind

Building your customized Modernizr>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-saucelabs" not found. Is it installed?
>> Local Npm module "grunt-contrib-qunit" not found. Is it installed?
>> Local Npm module "grunt-contrib-nodeunit" not found. Is it installed?
.........OK

This is the modernizr task:

gulp.task('modernizr', function() {
  var stream = gulp
    .src('./style.css')
    .pipe(modernizr('modernizr-custom.js'))
    .pipe(uglify())
    .pipe(gulp.dest("./"))
});

Is that something related to my setup or gulp-modernizr?

Install failing

I'm trying to install this package the following way:

npm install --save-dev git://github.com/doctyper/gulp-modernizr.git

Also by just cloning the rep and then running npm install in it.

Both ways give me this error:

> [email protected] postinstall c:\Users\grunningO\Desktop\ghost\content\themes\laban\node_moules\customizr
> if [[ -d node_modules/modernizr ]]; then ( cd node_modules/modernizr; npm install --prodution; cd -; ); fi

Oväntat -d.

npm ERR! [email protected] postinstall: `if [[ -d node_modules/modernizr ]]; then ( cd node_mdules/modernizr; npm install --production; cd -; ); fi`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.

I'm on Windows, if that makes any difference.

Would love some help or insight on how I could resolve this error, would really love to use your awesome customizr.

gulp-modernizr is looking for grunt modules

When building my customized Modernizr file, it’s looking for 4 npm modules:

  • grunt-contrib-connect
  • grunt-saucelabs
  • grunt-contrib-qunit
  • grunt-contrib-nodeunit

Although they can’t be found the build is still successful. Just wanted you to know.

Error when using gulp#4.0

I use the following task:

// Modernizr
gulp.task('modernizr', function() {
    return gulp.src(
            [
                 'src/styles/**/*.sass',
                 'src/scripts/**/*.js'
            ]
        )
        .pipe(modernizr({
            cache : false,
            options: [
                'setClasses'
            ],
            tests: [
                'touchevents',
                'ellipsis',
                'flexbox',
                'flexboxlegacy',
                'csstransforms',
                'csstransitions',
                'cssanimations',
                'mediaqueries',
                'objectfit',
            ]
        }))
        .pipe(gulp.dest('dist/scripts'));
});

while using the following node and gulp versions:

node: v9.3.0
gulp: 4.0.0-alpha.3
gulp-cli: 2.0.0

When running the modernizr task I get the following error:

Error: premature close
    at Pumpify.onclose (/project/node_modules/end-of-stream/index.js:43:67)
    at Pumpify.emit (events.js:159:13)
    at Pumpify.Duplexify._destroy (/project/node_modules/duplexify/index.js:192:8)
    at /project/node_modules/duplexify/index.js:175:10
    at process._tickCallback (internal/process/next_tick.js:150:11)

Does anyone experience the same problem? It probably has something to do with using gulp#4.0. It works fine with gulp#3.9.1.

How does this contain Modernizr 3

I was trying to understand how this package is using Modernizr 3. Mainly so that I could customize it to use an older version that is compatible with Foundation 5. Anyway, I was going through your customizr and realized that it is using the tarball url that points to version v2.6.2. So where is 3 coming from? Do I have an incorrect understanding of how this works?

Gulp `"options"` vs Grunt `"extra"` … parity?

I've used grunt-modernizr before, but on my current project we're using Gulp, and I'd like to use this project to the same end. However, the configuration looks different to me and the README on customizr isn't helping too much. On customizr the configuration options look like:

{
  options: [
    'setClasses',
    'addTest',
    'html5printshiv',
    'testProp',
    'fnBind'
  ]
}

… but I'm not sure how (or if) these options map to Modernizr's "Extra" section. It was a little clearer with grunt-modernizr:

{
  extra: {
    shiv: true,
    printshiv: false,
    load: true,
    mq: false,
    cssclasses: true
  }
}

… I had a configuration I liked in grunt-modernizr. What's the easiest way to re-create that configuration with the Gulp version? Thanks!

package.json

How install this repo from package.json with save dependencies?

"crawl: false" being ignored

I've set in my task configuration not to crawl my source files but the output says it's still doing so.

gulp.task("modernizr", function () {
    return gulp.src(paths.scripts + "*.js")
        .pipe(modernizr(config.modernizr, { "crawl": false, "options": ["mq", "setClasses"], "tests": ["pointerevents", "touchevents"] }))
        .pipe(gulp.dest("."));
});

The output says: Looking for Modernizr references and the resulting file also contains more tests than configured.

Add to npm

I'm receiving a 404 when attempting to install via npm as per instructions. I see that this is a new project, so perhaps it's not quite ready yet or you haven't had time to publish it. I have no problems installing via git, but should I be concerned about this being ready for primetime?

andyair:~ andrew$ npm install --save-dev gulp-modernizr
npm http GET https://registry.npmjs.org/gulp-modernizr
npm http 404 https://registry.npmjs.org/gulp-modernizr
npm ERR! 404 'gulp-modernizr' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it

Repository cannot be installed?

Hey there, I've been trying to install the repository via NPM both in its registry and with the GIT url and I'm getting the following errors:

npm install --save-dev gulp-modernizr
npm WARN package.json [email protected] No repository field.
npm http GET https://registry.npmjs.org/gulp-modernizr
npm http 404 https://registry.npmjs.org/gulp-modernizr
npm ERR! 404 'gulp-modernizr' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

and with the GIT url ...

npm install --save-dev https://github.com/doctyper/gulp-modernizr
npm WARN package.json [email protected] No repository field.
npm http GET https://github.com/doctyper/gulp-modernizr
npm http 200 https://github.com/doctyper/gulp-modernizr
npm ERR! not a package /var/folders/v3/7m8n_d617kzdvw3z2m6kttlr0000gn/T/npm-6344-rNguOVd-/1403471157007-0.10342534794472158/tmp.tgz
npm ERR! Error: ENOENT, open '/var/folders/v3/7m8n_d617kzdvw3z2m6kttlr0000gn/T/npm-6344-rNguOVd-/1403471157007-0.10342534794472158/package/package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/isaacs/npm/issues>

Perhaps something to do with the package.json?

Hope that helps,
Luke

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.