Skip to content

Commit

Permalink
closes ruanyl#9 running two hooks instead of one
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-heka committed Sep 3, 2021
1 parent c5fd152 commit 065f127
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ export default class WebpackRemoteTypesPlugin {
}

apply(compiler: Compiler) {
compiler.hooks.beforeRun.tapPromise('WebpackRemoteTypesPlugin', () => {
const pluginCallback = () => {
return downloadFederationTypes(
this.options.remotes,
path.resolve(cwd, this.options.outputDir),
this.options.remoteFileName
)
})
};
compiler.hooks.run.tapPromise('WebpackRemoteTypesPlugin', pluginCallback);
compiler.hooks.watchRun.tapPromise('WebpackRemoteTypesPlugin', pluginCallback);
}
}

0 comments on commit 065f127

Please sign in to comment.