From d555f84f3a765cd4a19ac009bfe083713e07c29a Mon Sep 17 00:00:00 2001 From: Yuri Date: Fri, 27 Dec 2024 10:53:00 -0500 Subject: [PATCH] Add `wasm` to the compressible assets regex Wasm files are often highly compressible and it would be nice to show their compressed size in Vite builds. I found an earlier PR (https://github.com/vitejs/vite/pull/12485) that made this change for some other asset types, and a [comment](https://github.com/vitejs/vite/pull/12485#issuecomment-1763361804) that sounded open to the addition of wasm to the list, which I've added. --- packages/vite/src/node/plugins/reporter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/plugins/reporter.ts b/packages/vite/src/node/plugins/reporter.ts index 4f97184dc0522e..10b9334d398585 100644 --- a/packages/vite/src/node/plugins/reporter.ts +++ b/packages/vite/src/node/plugins/reporter.ts @@ -24,7 +24,7 @@ type LogEntry = { mapSize: number | null } -const COMPRESSIBLE_ASSETS_RE = /\.(?:html|json|svg|txt|xml|xhtml)$/ +const COMPRESSIBLE_ASSETS_RE = /\.(?:html|json|svg|txt|xml|xhtml|wasm)$/ export function buildReporterPlugin(config: ResolvedConfig): Plugin { const compress = promisify(gzip)