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

Commit

Permalink
refactor: pass a unique compiler name to get child compilation (#483)
Browse files Browse the repository at this point in the history
This is recommended after webpack/webpack#4704
  • Loading branch information
sokra authored and joshwiens committed Jun 11, 2017
1 parent dd43832 commit 77daf83
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 @@ -47,20 +47,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 77daf83

Please sign in to comment.