docs(tui): clarify why @hermes/ink is aliased to source in build.mjs
Update the comment on the `alias` entry to mention the second reason the source-inline is needed: keeping the upstream `ink` / `ink-text-input` graph out of the bundle (which fixed the startup deadlock in #31227). Code path is unchanged.
This commit is contained in:
parent
18297899d7
commit
53d2c4191f
1 changed files with 8 additions and 3 deletions
|
|
@ -35,9 +35,14 @@ await build({
|
|||
outfile: out,
|
||||
jsx: 'automatic',
|
||||
jsxImportSource: 'react',
|
||||
// Skip the prebuilt @hermes/ink bundle — esbuild's __esm helper doesn't
|
||||
// await nested async init, which breaks lazy-initialized exports like
|
||||
// `render`. Bundling from source sidesteps that.
|
||||
// Skip the prebuilt @hermes/ink bundle and inline the source instead:
|
||||
// (1) esbuild's `__esm` helper does not await nested async init, so the
|
||||
// prebuilt bundle's lazy `render` would never resolve when nested in
|
||||
// this top-level Promise.all; (2) bundling from source also lets us
|
||||
// keep `ink-text-input` and the upstream `ink` graph OUT of the
|
||||
// bundle entirely — re-exporting them from entry-exports created a
|
||||
// circular async chain that hung the TUI at startup with only ANSI
|
||||
// reset bytes on screen (#31227).
|
||||
alias: { '@hermes/ink': resolve(root, 'packages/hermes-ink/src/entry-exports.ts') },
|
||||
plugins: [stubDevtools],
|
||||
// Some transitive deps use CommonJS `require(...)` at runtime. ESM bundles
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue