jiti icon indicating copy to clipboard operation
jiti copied to clipboard

Automatically enable `tryNative` for Deno

Open lucacasonato opened this issue 3 months ago • 1 comments

Describe the feature

While investigating some performance traces in Deno today, I noticed a program spending 200ms loading jiti, mostly because of it's bundled babel dependency.

This is not great because jiti is not needed in Deno, as Deno already supports cjs/ESM interop, and TypeScript transpilation out of the box.

Could you use an export condition to just always alias jiti to jiti/native in Deno? The export condition is "deno".

Additional information

  • [x] Would you be willing to help implement this feature?

lucacasonato avatar Sep 19 '25 21:09 lucacasonato

Following up from the discussion in #403, we cannot force resolve to jiti/native as some non-standard behavior is not covered.

Lazy loading of transfromer introduced in #405

Instead, we can enable tryNative option by default in the Deno runtime, similar to Bun (considering we won't add new user warnings, which should be tested)

pi0 avatar Sep 22 '25 12:09 pi0