report total size at the end

This commit is contained in:
bitterpanda 2025-12-03 16:18:24 +01:00
parent 0a4c6ed5db
commit 7abbd4aee9

View file

@ -1,5 +1,5 @@
import { build } from "esbuild"; import { build } from "esbuild";
import { mkdir, cp, rm, readFile, writeFile } from "node:fs/promises"; import { mkdir, cp, rm, readFile, writeFile, stat } from "node:fs/promises";
import { spawn } from "node:child_process"; import { spawn } from "node:child_process";
import { resolve } from "node:path"; import { resolve } from "node:path";
@ -36,8 +36,9 @@ if (!target) {
console.log(`- Built safe-chain binary for ${target} (pkg) ✅`) console.log(`- Built safe-chain binary for ${target} (pkg) ✅`)
const endBuildTime = performance.now(); const totalBuildTime = (performance.now() - startBuildTime)/1000;
console.log(`🏁 Finished build in ${((endBuildTime - startBuildTime)/1000).toFixed(2)}s`); const totalSizeInMb = (await stat("./dist/safe-chain")).size / (1024*1024);
console.log(`🏁 Finished build in ${totalBuildTime.toFixed(2)}s, total build size: ${totalSizeInMb.toFixed(2)}MB`);
})(); })();
async function clearOutputFolder() { async function clearOutputFolder() {