Use a separate cache for the child compilation.

Sharing the cache cause bad issues with wrong module ids.
This commit is contained in:
Tobias Koppers 2016-01-18 23:48:14 +01:00
parent 9e7cc462ba
commit b42074844c
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) {