1
0
Эх сурвалжийг харах

Webpack createChildCompiler api will drop SingleEntryPlugin complication hook

佛肚 6 жил өмнө
parent
commit
dbbbc1b531

+ 2 - 1
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);
   }
 }