mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-12 00:53:55 +00:00
18 lines
482 B
JavaScript
18 lines
482 B
JavaScript
|
const ProgressBar = require('node-progress-bars')
|
||
|
const webpack = require('webpack')
|
||
|
|
||
|
module.exports = function ProgressPlugin({ color, pcolor, title }) {
|
||
|
// https://github.com/bubkoo/ascii-progress
|
||
|
const bar = new ProgressBar({
|
||
|
schema: `${title}.${color} >.grey :filled.${pcolor}:blank.white :msg.grey`,
|
||
|
filled: '█',
|
||
|
blank: '█',
|
||
|
total: 100,
|
||
|
width: 25
|
||
|
})
|
||
|
|
||
|
return new webpack.ProgressPlugin((percent, msg) => {
|
||
|
bar.update(percent, { msg })
|
||
|
})
|
||
|
}
|