From 50a923af33a8c8e50659f1e544b7127948968e1b Mon Sep 17 00:00:00 2001 From: ZHAO Jinxiang Date: Wed, 2 Feb 2022 20:22:24 +0800 Subject: [PATCH] feat: add build stats hash support --- .../@vue/cli-service/lib/commands/build/formatStats.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/@vue/cli-service/lib/commands/build/formatStats.js b/packages/@vue/cli-service/lib/commands/build/formatStats.js index a6dec9554f..42ccbc71c7 100644 --- a/packages/@vue/cli-service/lib/commands/build/formatStats.js +++ b/packages/@vue/cli-service/lib/commands/build/formatStats.js @@ -68,5 +68,10 @@ module.exports = function formatStats (stats, dir, api) { )).join(`\n`) ) - return `${ui.toString()}\n\n ${chalk.gray(`Images and other types of assets omitted.`)}\n` + const time = stats.endTime - stats.startTime + const now = new Date().toISOString() + const hash = stats.hash + const info = `Build at: ${chalk.white(now)} - Hash: ${chalk.white(hash)} - Time: ${chalk.white(time)}ms` + + return `${ui.toString()}\n\n ${chalk.gray(`Images and other types of assets omitted.`)}\n ${info}\n` }