Skip to content

Instantly share code, notes, and snippets.

@michaelBenin
Created February 16, 2014 17:45
Show Gist options
  • Save michaelBenin/9037900 to your computer and use it in GitHub Desktop.
Save michaelBenin/9037900 to your computer and use it in GitHub Desktop.
TODO: Shim config for browserify with bower
var shimConfig = (function (grunt) {
return function (property) {
var shim = {};
var dir = grunt.file.readJSON('package.json').browserDependencies[property].dir;
grunt.file.readJSON('package.json').browserDependencies[property].files
.forEach(function (conf) {
var currentShim = shim[conf.require_by] = {};
currentShim.path = dir + '/' + Object.keys(conf)[0];
currentShim.exports = conf.exports;
if (conf.depends) {
currentShim.depends = conf.depends;
}
});
return shim;
};
}(grunt));
@michaelBenin
Copy link
Author

Creates a browserify-shim config for grunt-browserify, example uses grunt-browserDependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment