From 53c715873c12c17d375bebd376f3ef30fb68235f Mon Sep 17 00:00:00 2001 From: xzq <53166933+Mr-xzq@users.noreply.github.com> Date: Sat, 3 Dec 2022 14:50:51 +0800 Subject: [PATCH] =?UTF-8?q?chore(build):=20=E5=BD=93=20vite.config.ts=20?= =?UTF-8?q?=E7=9A=84=E6=89=93=E5=8C=85=E8=B7=AF=E5=BE=84=20build.outDir=20?= =?UTF-8?q?=E4=B8=8D=E6=98=AF=E9=BB=98=E8=AE=A4=E5=80=BC=20dist=20?= =?UTF-8?q?=E6=97=B6,=20getPackageSize=20=E6=96=B9=E6=B3=95=E4=BC=9A?= =?UTF-8?q?=E5=87=BA=E9=94=99=20(#391)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: zhiqi.xiao --- build/info.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/info.ts b/build/info.ts index 42d9bf67c..be4797738 100644 --- a/build/info.ts +++ b/build/info.ts @@ -9,10 +9,12 @@ export function viteBuildInfo(): Plugin { let config: { command: string }; let startTime: Dayjs; let endTime: Dayjs; + let outDir: string; return { name: "vite:buildInfo", - configResolved(resolvedConfig: { command: string }) { + configResolved(resolvedConfig) { config = resolvedConfig; + outDir = resolvedConfig.build?.outDir ?? "dist"; }, buildStart() { console.log( @@ -32,6 +34,7 @@ export function viteBuildInfo(): Plugin { if (config.command === "build") { endTime = dayjs(new Date()); getPackageSize({ + folder: outDir, callback: (size: string) => { console.log( bold(