From dbbbc1b531cca50d5dfb41d71fd610a80206c2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=9B=E8=82=9A?= Date: Mon, 10 Sep 2018 17:09:30 +0800 Subject: [PATCH] Webpack createChildCompiler api will drop SingleEntryPlugin complication hook --- plugins/AddWorkerEntryPointPlugin.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/AddWorkerEntryPointPlugin.js b/plugins/AddWorkerEntryPointPlugin.js index 4d7e4aa9..d935c2e0 100644 --- a/plugins/AddWorkerEntryPointPlugin.js +++ b/plugins/AddWorkerEntryPointPlugin.js @@ -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); } }