Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
grunt-modernizr
Advanced tools
grunt-modernizr
sifts through your project files, gathers up your references to Modernizr tests and outputs a lean, mean Modernizr machine.grunt-modernizr
is a Modernizr builder for your project. It is based on the Modernizr team's Modulizr tool.
This highly configurable task allows you to configure and export a custom Modernizr build. Use Modernizr's annotated source for development, and let this tool worry about optimization.
When you're ready to build, grunt-modernizr
will crawl your project for Modernizr test references and save out a minified, uglified, customized version using only the tests you've used in your JavaScript or (S)CSS.
Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-modernizr
Then add this line to your project's grunt.js
gruntfile:
grunt.loadNpmTasks("grunt-modernizr");
Run the task with grunt modernizr
.
Bust the cache of locally downloaded files by running grunt modernizr:bust
Add a modernizr
config object to your grunt.js file:
modernizr: {
// [REQUIRED] Path to the build you're using for development.
"devFile" : "lib/modernizr-dev.js",
// [REQUIRED] Path to save out the built file.
"outputFile" : "build/modernizr-custom.js",
// Based on default settings on http://modernizr.com/download/
"extra" : {
"shiv" : true,
"printshiv" : false,
"load" : true,
"mq" : false,
"cssclasses" : true
},
// Based on default settings on http://modernizr.com/download/
"extensibility" : {
"addtest" : false,
"prefixed" : false,
"teststyles" : false,
"testprops" : false,
"testallprops" : false,
"hasevents" : false,
"prefixes" : false,
"domprefixes" : false
},
// By default, source is uglified before saving
"uglify" : true,
// Define any tests you want to impliticly include.
"tests" : [],
// By default, this task will crawl your project for references to Modernizr tests.
// Set to false to disable.
"parseFiles" : true,
// When parseFiles = true, this task will crawl all *.js, *.css, *.scss files.
// You can override this by defining a "files" array below.
// "files" : [],
// When parseFiles = true, matchCommunityTests = true will attempt to
// match user-contributed tests.
"matchCommunityTests" : false,
// Have custom Modernizr tests? Add paths to their location here.
"customTests" : [],
// Files added here will be excluded when looking for Modernizr refs.
"excludeFiles" : []
}
devFile
(String)Path to the local build file you're using for development. This parameter is needed so grunt-modernizr
can skip your dev file when traversing your project to avoid triggering false positives. If you're using a remote file for development, set this option to remote
.
outputFile
(String)Path to save the customized Modernizr build. It defaults to lib/modernizr-custom.js
.
extra
(Object)An object of extra configuration options. Check the extra section on modernizr.com/download for complete options. Defaults are as they appear on the official site.
extensibility
(Object)An object of extensibility options. Check the section on modernizr.com/download for complete options. Defaults are as they appear on the official site.
uglify
(Boolean)By default, the source is uglified before save. Set to false to disable.
tests
(Array)Define any tests you want to impliticly include. Test names are lowercased, separated by underscores (if needed). Check out the full set of test options here.
parseFiles
(Boolean)By default, this task will crawl your project for references to Modernizr tests. Set to false to disable.
files
(Array)When parseFiles
= true
, this task will crawl all *.js
, *.css
, *.scss
files. You can override this by defining a custom files
array. The object supports all minimatch options.
matchCommunityTests
(Boolean)When parseFiles
= true
, setting this boolean to true will attempt to match user-contributed tests. Check out the full set of community tests here
customTests
(Array)Have custom Modernizr tests? Add paths to their location here. The object supports all minimatch options.
excludeFiles
(Array)Files added here will be excluded when looking for Modernizr refs. The object supports all minimatch options.
Copyright (c) 2012 Richard Herrera Licensed under the MIT license.
FAQs
Build out a lean, mean Modernizr machine.
The npm package grunt-modernizr receives a total of 2,429 weekly downloads. As such, grunt-modernizr popularity was classified as popular.
We found that grunt-modernizr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.