webpack/grunt-webpack — pull request #9 by altano (2013-05-19 04:54:03+00:00)
Title: Make Plugins use interpolated Grunt templates (e.g. BannerPlugin)

The BannerPlugin isn't interpolating the template I am passing in, which
will just about always be the case for someone using it. I investigated
and it looks like the culprit is in grunt-webpack/tasks/webpack.js:

function getWithPlugins(ns) {
var obj = grunt.config(ns);
if(obj.plugins) obj.plugins =
grunt.config.getRaw(ns.concat(["plugins"]));
return obj;
}

This is clobbering the interpolated text with uninterpolated text. I
understand why: grunt.config() turned the plugin objects into generic
Object instances and grunt.config.getRaw() restores them to plugin
instances, e.g. BannerPlugin. The only problem is that grunt templates
end up being reverted too.

This fixes that issue by enumerating all the plugin properties and
processing any strings through grunt.template.process().