From d5b0b40b171e3f729e0316c04a078ed2a02fa430 Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Sun, 25 Oct 2026 20:17:20 -0400 Subject: [PATCH] chore(build): ship only the DTLN files that can load (-9 MB) (#210) The DTLN noise-suppression package was copied whole into every build (57 MB). Its threaded LiteRT build is only used on a cross-origin-isolated page, and neither the web nor the desktop call page is (no COOP/COEP), so its ~9 MB could never load; source maps and .d.ts files aren't needed at runtime either. Leave those out: 57 -> 48 MB per web deploy and desktop installer. Verified on the built output, not isolated: the DTLN worklet reaches ready and runs a 300-frame benchmark, no 404s. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5 --- vite.config.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/vite.config.js b/vite.config.js index 209d095b4..8e0638c3e 100644 --- a/vite.config.js +++ b/vite.config.js @@ -189,7 +189,17 @@ function lotusDenoise() { 'Run `npm ci` to install @workadventure/noise-suppression.', ); } - fs.cpSync(dtln[0], path.join(denoiseDir, dtln[1]), { recursive: true }); + // [Gitea #210] Ship only what can load. The threaded LiteRT build is used + // only on a cross-origin-isolated page (COOP + COEP), and neither the web + // call page nor the desktop one is, so its ~9 MB never loads; source maps + // and type declarations aren't needed at runtime either. If the call page + // ever turns on COOP/COEP, drop the `threaded` exclusion. + const dtlnSkip = (src) => + /litert_wasm_threaded_internal\./.test(src) || /\.(map|d\.ts)$/.test(src); + fs.cpSync(dtln[0], path.join(denoiseDir, dtln[1]), { + recursive: true, + filter: (src) => !dtlnSkip(src), + }); const dfnMissing = dfn.filter(([s]) => !fs.existsSync(s)).map(([s]) => s); if (dfnMissing.length > 0) {