diff --git a/src/frontend.ts b/src/frontend.ts index 3820659..324c578 100644 --- a/src/frontend.ts +++ b/src/frontend.ts @@ -7,4 +7,8 @@ export function frontend(code: Function) { export function feFunctions(): string[] { return funcs +} + +export function clearFeFunctions() { + funcs.length = 0 } \ No newline at end of file diff --git a/src/index.tsx b/src/index.tsx index 2ac73f6..5d72626 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -6,7 +6,7 @@ import color from 'kleur' import { transpile } from './utils' import defaultLayout from './layout' -import { feFunctions } from './frontend' +import { feFunctions, clearFeFunctions } from './frontend' const SHOW_HTTP_LOG = true const CSS_RESET = await Bun.file(join(import.meta.dir, '/reset.css')).text() @@ -101,6 +101,7 @@ export class Hype< const res = c.res.clone() const html = await res.text() const newHtml = html.replace('', ``) + clearFeFunctions() c.res = new Response(newHtml, c.res) })