From 236570311412110b506446df5e6eaee9db3ffa87 Mon Sep 17 00:00:00 2001 From: codehz Date: Sun, 28 Jul 2024 19:10:05 +0800 Subject: [PATCH] use hack --- build.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build.ts b/build.ts index 0dbd189..5a4a907 100644 --- a/build.ts +++ b/build.ts @@ -83,7 +83,14 @@ export async function build({ build.onLoad( { namespace: "client", filter: /\.ts[x]$/ }, async ({ path, loader }) => { - return { contents: await Bun.file(path).text(), loader }; + const contents = await Bun.file(path).text(); + return { + contents: contents.replaceAll( + /\/\/\s*@server-side[^\n\S]*\n[^\n]+\n/g, + "" + ), + loader, + }; } ); },