-
-
Notifications
You must be signed in to change notification settings - Fork 655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add runtime conditions into package.json
#852
Comments
Hi @yujong-lee ! If you are interested, check it out. |
The new version of Wrangler supports the conditional And Bun also looks up the exports field if it has |
According the project: we can write the {
"name": "isomorphic-random-example",
"version": "0.0.1",
"private": true,
"exports": {
"node": "./src/node.js",
"workerd": "./src/workerd.mjs"
}
} This is a very interesting way to have references to, for example, workerd.js for workerd, deno.js for deno, and bun.js for bun. But, in the case of Hono, all runtimes only need to refer to one index.js, so it doesn't make much sense:) |
It does not seem necessary to go this far. |
Hono supports JavaScript multi-runtime, and WinterCG defines the standard keys for that (
c.runtime
already returns the runtime key on which the app runtime running). Then I know we can include the keys inpackage.json
for specifiying conditions like Wrangler doing:workerd
condition when bundling cloudflare/workers-sdk#2629I don't know yet what effect it will have on Hono, but I think it is good we will challenge it.
The text was updated successfully, but these errors were encountered: