Skip to content

Commit

Permalink
feat(task): process templates in the config
Browse files Browse the repository at this point in the history
Templates in the preprocessors config are now
properly processed.
  • Loading branch information
dsuckau authored and dignifiedquire committed Jan 9, 2015
1 parent 72dc9ea commit a10aaa7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tasks/grunt-karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ module.exports = function(grunt) {
data.files = _.flatten(data.files);
}

// Allow the use of templates in preprocessors
if (_.isPlainObject(data.preprocessors)) {
var preprocessors = {};
Object.keys(data.preprocessors).forEach(function (key) {
var value = data.preprocessors[key];
key = path.resolve(key);
key = grunt.template.process(key);
preprocessors[key] = value;
});
data.preprocessors = preprocessors;
}

//support `karma run`, useful for grunt watch
if (this.flags.run){
runner.run(data, finished.bind(done));
Expand Down

0 comments on commit a10aaa7

Please sign in to comment.