From b42074844ce22cfc711838317cc1907f92bd6e07 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 18 Jan 2016 23:48:14 +0100 Subject: [PATCH] Use a separate cache for the child compilation. Sharing the cache cause bad issues with wrong module ids. --- lib/compiler.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/compiler.js b/lib/compiler.js index 55378e9f..c4f0c1d1 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -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) {