show more detailed progress

This commit is contained in:
Pooya Parsa 2018-03-16 10:15:31 +03:30
parent f66e43d68a
commit 4cea3fb159

View File

@ -10,7 +10,7 @@ module.exports = class ProgressPlugin extends webpack.ProgressPlugin {
constructor(options) { constructor(options) {
super(options) super(options)
this.handler = (percent, msg) => this.updateProgress(percent, msg) this.handler = (percent, msg, ...details) => this.updateProgress(percent, msg, details)
this.options = options this.options = options
@ -27,7 +27,7 @@ module.exports = class ProgressPlugin extends webpack.ProgressPlugin {
return sharedState[this.options.name] return sharedState[this.options.name]
} }
updateProgress(percent, msg) { updateProgress(percent, msg, details) {
const progress = Math.floor(percent * 100) const progress = Math.floor(percent * 100)
this.state.progress = progress this.state.progress = progress
@ -76,8 +76,7 @@ module.exports = class ProgressPlugin extends webpack.ProgressPlugin {
}) })
// Update spinner // Update spinner
this.spinner.start() this.spinner.start()
this.spinner.text = 'Compiling ' + progressbars.join('') + ' ' + additional.join(' ') this.spinner.text = _.startCase(msg) + ' ' + progressbars.join('') + ' ' + additional.join(' ')
} }
} }