Webpack createChildCompiler api will drop SingleEntryPlugin complication hook

pull/2748/head
佛肚 2018-09-10 17:09:30 +08:00
parent cb473c82aa
commit dbbbc1b531
1 changed files with 2 additions and 1 deletions

View File

@ -15,9 +15,10 @@ function getCompilerHook(compiler, {id, entry, filename, chunkFilename, plugins}
const childCompiler = compilation.createChildCompiler(id, outputOptions, [
new WebWorkerTemplatePlugin(),
new LoaderTargetPlugin('webworker'),
new SingleEntryPlugin(compiler.context, entry, 'main'),
]);
new SingleEntryPlugin(compiler.context, entry, 'main').apply(childCompiler);
plugins.forEach((plugin) => plugin.apply(childCompiler));
childCompiler.runAsChild(callback);
}
}