diff --git a/lib/replace.js b/lib/replace.js index 22ac3e9..d84ba40 100644 --- a/lib/replace.js +++ b/lib/replace.js @@ -22,8 +22,8 @@ exports.init = function(grunt) { } // iterate over all modules that are configured for replacement - config.replaceRequireScript.forEach(function (file, idx) { - var files = grunt.file.expand(file.files); + config.replaceRequireScript.forEach(function (entry, idx) { + var files = grunt.file.expand(entry.files); var filesEvaluated = 0; // iterate over found html files @@ -38,7 +38,7 @@ exports.init = function(grunt) { var $ = cheerio.load(match), elm = $('script'); if (elm.attr('data-main')){ - var insertScript = (file.modulePath || elm.attr('data-main')); + var insertScript = (entry.modulePath || elm.attr('data-main')); elm.attr('src', insertScript + '.js'); elm.removeAttr('data-main'); // replace i'th occurrence in content