Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
grunt-resolve-json.js: Load map.json and resolve paths
module.exports = function(grunt){
var path = require("path"),
_ = grunt.util._;
/**
* Resolve dest and src files' path
* @param {String} file
* @returns {Object}
*/
grunt.resolveJSON = function(file){
var dir, data, files = {};
dir = path.dirname(file);
data = grunt.file.readJSON(file);
_.each(data, function(src, dest){
files[path.join(dir, dest)] = src.map(function(name){
return path.join(dir, name);
});
});
return files;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.