diff --git a/lib/builder/builder.mjs b/lib/builder/builder.mjs index 3eb9331df4..57c3a835ed 100644 --- a/lib/builder/builder.mjs +++ b/lib/builder/builder.mjs @@ -15,7 +15,7 @@ import Debug from 'debug' import Glob from 'glob' import upath from 'upath' -import { r, wp, wChunk, createRoutes, parallel, relativeTo, waitFor, createSpinner } from '../common/utils' +import { r, wp, wChunk, createRoutes, parallel, sequence, relativeTo, waitFor, createSpinner } from '../common/utils' import Options from '../common/options' import PerfLoader from './webpack/utils/perf-loader' @@ -474,7 +474,9 @@ export default class Builder { } // Start Builds - await parallel(this.compilers, compiler => { + const runner = this.options.dev ? parallel : sequence + + await runner(this.compilers, compiler => { return this.webpackCompile(compiler) }) } diff --git a/lib/builder/webpack/plugins/progress.mjs b/lib/builder/webpack/plugins/progress.mjs index 85304cc0d5..a5ca32c176 100644 --- a/lib/builder/webpack/plugins/progress.mjs +++ b/lib/builder/webpack/plugins/progress.mjs @@ -44,19 +44,22 @@ export default class ProgressPlugin extends webpack.ProgressPlugin { const progress = Math.floor(percent * 100) this.state.progress = progress - this.state.msg = (msg && msg.length) ? msg : (progress === 100 ? 'done' : 'still building') + this.state.msg = msg this.state.details = details + this.state.isRunning = (progress && progress !== 100) && (msg && msg.length) // Process all states - let inProgress = false + let isRunning = false const lines = [] _.sortBy(Object.keys(sharedState), s => s.name).forEach(name => { const state = sharedState[name] - if (state.progress < 100) { - inProgress = true + if (state.isRunning) { + isRunning = true + } else { + return } const _color = chalk.keyword(state.color) @@ -70,7 +73,7 @@ export default class ProgressPlugin extends webpack.ProgressPlugin { lines.push([_icon, _name, _bar, _msg, _progress].join(' ')) }) - if (!inProgress) { + if (!isRunning) { logUpdate.clear() } else { const title = chalk.bgRedBright.black('BUILDING') diff --git a/lib/common/utils.mjs b/lib/common/utils.mjs index 405f0394c2..ded3f4d663 100644 --- a/lib/common/utils.mjs +++ b/lib/common/utils.mjs @@ -38,8 +38,8 @@ export const createSpinner = function ({ minimal = false }) { // eslint-disable-next-line no-console const createLogger = (tag, ctx) => (...args) => ctx.enabled && console.log( - `[${(new Date().toISOString)()}]`, - _.padEnd(`[${tag}]`, 10), + _.padEnd(`[${tag.toUpperCase()}]`, 9), + `[${new Date().toLocaleTimeString()}]`, ...args )