Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

Commit

Permalink
Remove Tapable.apply calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ooflorent committed Jan 23, 2018
1 parent 98816a1 commit 8de49e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,17 @@ export function pitch(request) {
worker.compiler = this._compilation
.createChildCompiler('worker', worker.options);

worker.compiler.apply(new WebWorkerTemplatePlugin(worker.options));
new WebWorkerTemplatePlugin(worker.options).apply(worker.compiler);

if (this.target !== 'webworker' && this.target !== 'web') {
worker.compiler.apply(new NodeTargetPlugin());
new NodeTargetPlugin().apply(worker.compiler);
}

worker.compiler.apply(new SingleEntryPlugin(this.context, `!!${request}`, 'main'));
new SingleEntryPlugin(this.context, `!!${request}`, 'main').apply(worker.compiler);

const subCache = `subcache ${__dirname} ${request}`;

// TODO use `worker.compiler.hooks.compilation.tap()` instead
worker.compiler.plugin('compilation', (compilation) => {
if (compilation.cache) {
if (!compilation.cache[subCache]) compilation.cache[subCache] = {};
Expand Down

0 comments on commit 8de49e4

Please sign in to comment.