Skip to content

Commit 49a1abf

Browse files
fix: bun compile example
1 parent 76bf094 commit 49a1abf

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
// Adds @kitajs/html's Html globally.
2-
import '@kitajs/html/register'
2+
// @ts-expect-error - When running from a compiled bun version,
3+
// this will fail because /register will be stripped out if not
4+
// used. This is just a workaround to make it work.
5+
import { noop } from '@kitajs/html/register'
6+
try {
7+
noop()
8+
} catch {}
39

410
export * from './html'
511
export * from './options'
612
export * from './utils'
713

8-
// We cannot use `export * as Html` because @kitajs/html uses `export =`
9-
export const Html = require('@kitajs/html') as typeof import('@kitajs/html')
14+
export { Html } from '@kitajs/html'

0 commit comments

Comments
 (0)