Skip to content

Commit

Permalink
Exposing Modernizr as a module
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenGremlin committed Dec 4, 2015
1 parent cea03bd commit 5423888
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@

var modernizr = require("modernizr");

function wrapOutput(output) {
// Exposing Modernizr as a module.
return ';(function(window){\n' +
output + '\n' +
'module.exports = window.Modernizr;\n' +
'})(window);';
}

module.exports = function (config) {
var cb = this.async();

modernizr.build(JSON.parse(config), function (output) {
cb(null, output);
cb(null, wrapOutput(output));
});
};

0 comments on commit 5423888

Please sign in to comment.