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

refactor: pass a unique compiler name to get child compilation (webpack 3) #483

Merged
merged 1 commit into from
Jun 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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