A Grunt wrapper for Modernizr.
Install this grunt plugin next to your project's Gruntfile.js
:
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 Gruntfile.js
with:
npm install grunt-modernizr --save-dev
Then add this line to your project's Gruntfile.js
:
grunt.loadNpmTasks("grunt-modernizr");
For Full Features & Configuration? → See Customizr
Run the task with grunt modernizr:dist
.
Add a modernizr
config object to your Gruntfile.js file. The task supports multiple targets:
modernizr: {
dist: {
"parseFiles": true,
"customTests": [],
"devFile": "/PATH/TO/modernizr-dev.js",
"dest": "/PATH/TO/modernizr-output.js",
"tests": [
// Tests
],
"options": [
"setClasses"
],
"uglify": true
}
}
You can also generate the configuration file online via the modernizr build tool. Just configure your build, click the Build button, and download/copy the Grunt Config.
See the customizr repository for valid settings.
Copyright (c) 2024 The Modernizr team Licensed under the MIT license.