From 0b8443032eb40943df4a32ad107a934aa21a335e Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 27 Nov 2023 12:45:22 +1000 Subject: [PATCH] Fix JS proto definitions not getting tree-shaken --- ts/tools/markpure.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/tools/markpure.ts b/ts/tools/markpure.ts index 534038cce..8d7b30463 100644 --- a/ts/tools/markpure.ts +++ b/ts/tools/markpure.ts @@ -39,7 +39,7 @@ function adjustFiles() { // strip out typeName info, which appears to only be required for // certain JSON functionality (though this only saves a few hundred // bytes) - newContents = contents.replace(typeRe, "$1(\"\","); + newContents = newContents.replace(typeRe, "$1(\"\","); if (contents != newContents) { fs.writeFileSync(file, newContents, "utf8");