UNPKG

grunt-modernizr

Version:

Build out a lean, mean Modernizr machine.

41 lines (30 loc) 939 B
/* * grunt-modernizr * https://github.com/Modernizr/grunt-modernizr * * Copyright (c) 2012 Richard Herrera * Licensed under the MIT license. */ module.exports = function (grunt) { // ========================================================================== // TASKS // ========================================================================== grunt.registerMultiTask("modernizr", "Build out a lean, mean Modernizr machine.", function () { // Require a config object this.requiresConfig(this.name); // Async var done = this.async(); // The target from our multi-task var target = this.target || null; // The magic var customizr = require("customizr"); var _merge = require("lodash.merge"); var settings = _merge(this.options(), this.data); var noColors = grunt.option('no-color') === true; if (noColors) { settings.noColors = true; } // Go! return customizr(settings, done); }); };