[grunt/config] rename config for snake_cased tasks

This commit is contained in:
spalger 2016-03-07 14:38:49 -07:00
parent 00bf02ab29
commit 07e20936b5
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,4 @@
var camelCase = require('lodash').camelCase;
require('babel/register')(require('./src/optimize/babel_options').node);
module.exports = function (grunt) {
@ -81,6 +82,16 @@ module.exports = function (grunt) {
config: config,
loadGruntTasks: {
pattern: ['grunt-*', '@*/grunt-*', 'gruntify-*', '@*/gruntify-*', 'intern']
},
preMerge(config, data) {
Object.keys(config).forEach(key => {
const camelKey = camelCase(key);
if (key !== camelKey) {
grunt.log.debug(`renaming config for ${key} to ${camelKey}`);
config[camelKey] = config[key];
delete config[key];
}
});
}
});

View file

@ -176,7 +176,7 @@
"karma-safari-launcher": "0.1.1",
"libesvm": "3.3.0",
"license-checker": "3.1.0",
"load-grunt-config": "0.7.2",
"load-grunt-config": "0.19.1",
"makelogs": "3.0.0-beta3",
"marked-text-renderer": "0.1.0",
"mocha": "2.3.0",