Skip to content

Commit

Permalink
feat: webpack5 support for activeModule
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Nov 2, 2020
1 parent 1862017 commit 6ba2f82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions demo/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */

import 'chalk';
// import 'eslint';
// import 'standard-version';
import 'eslint';
import 'standard-version';
6 changes: 4 additions & 2 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const globalStates = {}

export default class WebpackBarPlugin extends ProgressPlugin {
constructor (options) {
super()
super({ activeModules: true })

this.options = Object.assign({}, DEFAULTS, options)

Expand Down Expand Up @@ -211,11 +211,13 @@ export default class WebpackBarPlugin extends ProgressPlugin {
updateProgress (percent = 0, message = '', details = []) {
const progress = Math.floor(percent * 100)

const activeModule = details.pop()

Object.assign(this.state, {
progress,
message: message || '',
details,
request: parseRequest(details[2])
request: parseRequest(activeModule)
})

this.callReporters('progress')
Expand Down

0 comments on commit 6ba2f82

Please sign in to comment.