From 6dde10c2aebe1cfba6a875e557384e5bace0c565 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Sat, 27 Sep 2025 16:52:40 -0700 Subject: [PATCH] fix transpiler caching, jsx runtime --- app/src/utils.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/utils.tsx b/app/src/utils.tsx index be29cd6..276e6c7 100644 --- a/app/src/utils.tsx +++ b/app/src/utils.tsx @@ -75,14 +75,15 @@ const transpileCache: Record = {} // Transpile the frontend *.ts file at `path` to JavaScript. export async function transpile(path: string): Promise { - const code = await Bun.file(path).text() - const { mtime } = await stat(path) const key = `${path}?${mtime}` let cached = transpileCache[key] if (!cached) { + const code = await Bun.file(path).text() cached = transpiler.transformSync(code) + cached = cached.replaceAll(/\bjsxDEV_?\w*\(/g, "jsx(") + transpileCache[key] = cached }