Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
pass a unique compiler name to get child compilation
Browse files Browse the repository at this point in the history
This is recommended after webpack/webpack#4704
  • Loading branch information
sokra committed Apr 13, 2017
1 parent a284f3a commit 6777369
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6777369

Please sign in to comment.