mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
simplify progress
This commit is contained in:
parent
13bae199ab
commit
1204ea45d4
@ -53,7 +53,7 @@ export default class ProgressPlugin extends webpack.ProgressPlugin {
|
||||
|
||||
const lines = []
|
||||
|
||||
_.sortBy(Object.keys(sharedState), s => s.name).forEach(name => {
|
||||
_.sortBy(Object.keys(sharedState), s => s.name).reverse().forEach(name => {
|
||||
const state = sharedState[name]
|
||||
|
||||
if (state.isRunning) {
|
||||
@ -85,11 +85,10 @@ export default class ProgressPlugin extends webpack.ProgressPlugin {
|
||||
_renderBar(progress, color) {
|
||||
const w = progress * (BAR_LENGTH / 100)
|
||||
const bg = chalk.white(BLOCK_CHAR)
|
||||
// const fg = chalk.keyword(color)(BLOCK_CHAR)
|
||||
const fg = chalk.keyword(color)(BLOCK_CHAR2)
|
||||
|
||||
const base = color === 'green' ? 120 : 50
|
||||
const fg = i => chalk.hsl(i * 3 + base, 100, 50)(BLOCK_CHAR2)
|
||||
|
||||
return BAR_BEFORE + _.range(BAR_LENGTH).map(i => i < w ? fg(i) : bg).join('') + BAR_AFTER
|
||||
return BAR_BEFORE +
|
||||
_.range(BAR_LENGTH).map(i => i < w ? fg : bg).join('') +
|
||||
BAR_AFTER
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user