Closed isadovskiy closed 9 years ago
Looks great! Few things, though.
I would rather it be upside down, like
globals.forEach(function(global) {
if (grunt.util.kindOf(global) === 'object') {
fragment = global;
} else {
if (!grunt.file.exists(global)) {
grunt.log.error("JSON file " + global + " not found.");
} else {
try {
fragment = grunt.file.readJSON(global);
} catch (e) {
grunt.fail.warn(e);
}
}
}
_merge(json, fragment);
});
Then, could you add a test file with the results you expect? Finally, add yourself to the contributors.md file, and please squash the whole thing down to a single commit
cheers!
NP! Will do tomorrow.
Creating another pull request
Right now globals option support just list of json files.
This pull request allows to provide plain JS objects for globals as well.