https://github.com/wevm/hono-jsx
JSX runtime imports for Hono
https://github.com/wevm/hono-jsx
Last synced: 9 months ago
JSON representation
JSX runtime imports for Hono
- Host: GitHub
- URL: https://github.com/wevm/hono-jsx
- Owner: wevm
- Created: 2024-02-12T21:33:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-12T21:35:17.000Z (over 2 years ago)
- Last Synced: 2025-01-17T05:09:12.323Z (over 1 year ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hono-jsx
Fork of [`hono/jsx` runtime exports](https://github.com/honojs/hono/blob/main/package.json#L122-L136) with direct import support.
> **What is "direct import support"?**
>
> In the [`hono`](https://github.com/honojs/hono) package, the `hono/jsx/*` entrypoints are exposed via [`package.json#exports`](https://github.com/honojs/hono/blob/main/package.json#L122-L136). Unfortunately, some runtimes & bundlers (most notably Vercel Edge Functions) have [poor support for `package.json#exports`](https://github.com/honojs/middleware/issues/333#issuecomment-1938293091). This fork exposes the `hono/jsx/*` entrypoints **directly** in the `hono-jsx` package, so that they can be imported without relying on `package.json#exports`.
## Install
```bash
npm i hono-jsx hono
```
## Usage
### via `tsconfig.json`
```json
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "hono-jsx"
}
}
```
### via pragma directives
```tsx
/** @jsx jsx */
/** @jsxImportSource hono-jsx */
```