Commit df40512
fix(ai-mcp): add shims to bin bundle for CJS dynamic-require compat (#754)
* fix(ai-mcp): add shims to bin bundle for CJS dynamic-require compat
json-schema-to-typescript (inlined via noExternal) uses dynamic require()
calls internally. When bundled into an ESM output the global require is
absent, causing the CLI to crash on startup with
"Dynamic require of 'fs' is not supported" before it can parse any args.
shims: true makes tsup inject a createRequire-based shim at the top of the
bundle so CJS dependencies can call require() safely from within the ESM
output.
Fixes #753
* chore: add changeset for ai-mcp CLI dynamic-require shim fix
* ci: apply automated fixes
---------
Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>1 parent 4041c2f commit df40512
2 files changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
0 commit comments