From 677736932034d8fb523784f827eda8658ff90ae1 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 13 Apr 2017 13:55:29 +0200 Subject: [PATCH] pass a unique compiler name to get child compilation This is recommended after https://github.com/webpack/webpack/pull/4704 --- loader.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/loader.js b/loader.js index 057763c2..ce31404c 100644 --- a/loader.js +++ b/loader.js @@ -49,20 +49,12 @@ module.exports.pitch = function(request) { filename: childFilename, publicPath: publicPath }; - var childCompiler = this._compilation.createChildCompiler("extract-text-webpack-plugin", outputOptions); + var childCompiler = this._compilation.createChildCompiler("extract-text-webpack-plugin " + NS + " " + request, outputOptions); childCompiler.apply(new NodeTemplatePlugin(outputOptions)); childCompiler.apply(new LibraryTemplatePlugin(null, "commonjs2")); childCompiler.apply(new NodeTargetPlugin()); childCompiler.apply(new SingleEntryPlugin(this.context, "!!" + request)); childCompiler.apply(new LimitChunkCountPlugin({ maxChunks: 1 })); - var subCache = "subcache " + NS + " " + request; // eslint-disable-line no-path-concat - childCompiler.plugin("compilation", function(compilation) { - if(compilation.cache) { - if(!compilation.cache[subCache]) - compilation.cache[subCache] = {}; - compilation.cache = compilation.cache[subCache]; - } - }); // We set loaderContext[NS] = false to indicate we already in // a child compiler so we don't spawn another child compilers from there. childCompiler.plugin("this-compilation", function(compilation) {