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
{{ message }}
Repository navigation
API Bun.build(...) doesn't read JSX directives from bunfig.toml (but CLI "bun build" does) #19556
error: Could not resolve: "react/jsx-dev-runtime". Maybe you need to "bun install"?
at /home/egnor/test/test.jsx
Bun v1.2.12 (Linux x64 baseline)
What is the expected behavior?
Expected: Bun.build({ entrypoints: ["test.jsx"] }) and bun build test.jsx would do roughly the same thing, both process bunfig.toml, and both succeed in translating this file with the specified settings
What do you see instead?
Actual: bun build test.jsx works, but Bun.build({ entrypoints: ["test.jsx"] }) does not, as it doesn't seem to be using the relevant parts of bunfig.toml.
(If it's not intended that bunfig.toml get read when using the API, this should surely be documented.)
Note that if the settings are made in the "compilerOptions" section of jsconfig.json instead of bunfig.toml, Bun.build(...) does work.
Additional information
(It would also be nice to be able to provide these settings in Bun.build(...)'s options?)
Activity
Bun.build: leave jsx.development unset by default