From 31a41130048082fd8823336240ab7a6bc4cb31b0 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Mon, 6 Jan 2025 00:07:44 +0700 Subject: [PATCH] fix(scripts/serve): missing build time --- scripts/serve.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/serve.mjs b/scripts/serve.mjs index 5ab2f02..9cff37a 100644 --- a/scripts/serve.mjs +++ b/scripts/serve.mjs @@ -11,9 +11,10 @@ const args = yargs(process.argv.slice(2)) export function serve() { const server = createServer(async (_, res) => { try { - const { config, context, timeTook } = await buildBundle() + const initialStartTime = performance.now() + const { config, context } = await buildBundle() - printBuildSuccess(context.hash, undefined, timeTook, false) + printBuildSuccess(context.hash, undefined, performance.now() - initialStartTime, false) res.writeHead(200, { 'Content-Type': 'application/javascript' }) res.end(await readFile(config.outfile, 'utf-8'))