From 8c3ac3257866fe8d8be296afd7eb8a3c062b81b3 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Wed, 10 Dec 2025 11:37:05 -0800 Subject: [PATCH] spacing --- src/index.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 8ba2038..789cf96 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -98,13 +98,17 @@ export class Hype< if (!path.endsWith('.js') && !path.endsWith('.ts')) path += '.ts' const ts = path.replace('.js', '.ts') - if (await Bun.file(ts).exists()) { + if (await Bun.file(ts).exists()) return new Response(await transpile(ts), { headers: { 'Content-Type': 'text/javascript' } }) - } else if (await Bun.file(path).exists()) { + + else if (await Bun.file(ts + 'x').exists()) + return new Response(await transpile(ts + 'x'), { headers: { 'Content-Type': 'text/javascript' } }) + + else if (await Bun.file(path).exists()) return new Response(Bun.file(path), { headers: { 'Content-Type': 'text/javascript' } }) - } else { + + else return render404(c) - } }) // file based routing