You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bundling/converting our own TS code to ESM and CJS (before publishing)
bundling managerEntries from source (possibly TS, from users/addons) to an output that can run directly in the browser, whilst globalizing certain modules
loading TS config files into node at runtime (main.ts) via esbuild-register
Can we replace it with a smaller runtime-bundler like jiti, that achieves the same thing?
The text was updated successfully, but these errors were encountered:
JReinhold
changed the title
Replace [esbuild](esbuild.github.io) with [jiti](https://github.com/unjs/jiti) for preset handling
Replace esbuild with jiti for preset handling
Sep 11, 2024
JReinhold
changed the title
Replace esbuild with jiti for preset handling
Migrate from esbuild to jiti for preset handling
Sep 11, 2024
Jiti has a different approach to enabling loading .ts-files from esbuild-register.
Jiti seems to transpile the files individually, and skip files that don't need to be transpiled.
esbuild-register actually bundles the entrypoint into a single (in memory?) file.
The difference between these approaches is that esbuild-register solves any incorrect CJS > EMS usage by bundling; jiti will leave those problematic connections in place, which then fail at runtime.
In my PR I needed to solve this in our codebase in at least 1 place. So there's a high chance this problem might be in multiple presets of ours or community presets, or even in presets of users'.
For this reason it's my recommendation to make this change in a breaking change.
Storybook currently use esbuild for 3 things:
managerEntries
from source (possibly TS, from users/addons) to an output that can run directly in the browser, whilst globalizing certain modulesmain.ts
) viaesbuild-register
Can we replace it with a smaller runtime-bundler like jiti, that achieves the same thing?
The text was updated successfully, but these errors were encountered: