clear fe functions after using them
This commit is contained in:
parent
ddce0c8589
commit
feb30369cf
|
|
@ -7,4 +7,8 @@ export function frontend(code: Function) {
|
|||
|
||||
export function feFunctions(): string[] {
|
||||
return funcs
|
||||
}
|
||||
|
||||
export function clearFeFunctions() {
|
||||
funcs.length = 0
|
||||
}
|
||||
|
|
@ -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('</body>', `<script>${fns.join('\n')}</script></body>`)
|
||||
clearFeFunctions()
|
||||
|
||||
c.res = new Response(newHtml, c.res)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user