Merge pull request #179 from sokra/cache-in-child

Child compilation must use a separate cache object
This commit is contained in:
Jan Nicklas 2016-01-19 07:31:16 +01:00
commit f74928b6e6
1 changed files with 7 additions and 0 deletions

View File

@ -50,6 +50,13 @@ module.exports.compileTemplate = function compileTemplate(template, context, out
new SingleEntryPlugin(this.context, template),
new LoaderTargetPlugin('node')
);
childCompiler.plugin("compilation", function(compilation) {
if(compilation.cache) {
if(!compilation.cache[compilerName])
compilation.cache[compilerName] = {};
compilation.cache = compilation.cache[compilerName];
}
});
// Compile and return a promise
return new Promise(function (resolve, reject) {