Skip to content

Commit

Permalink
feat: prevent adding multi instances to the same compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Nov 9, 2018
1 parent d51c508 commit 759a4e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ export default class WebpackBarPlugin extends ProgressPlugin {
}

apply(compiler) {
// Prevent adding multi instances to the same compiler
if (compiler.webpackbar) {
return;
}
compiler.webpackbar = this;

// Apply base hooks
super.apply(compiler);

// Hook into the compiler before a new compilation is created.
Expand Down

0 comments on commit 759a4e6

Please sign in to comment.