Using Bun build (it's awesome!) to bundle a UI library, migrating from a working tsup setup. Everything functionally works (build + downstream usage), but tsc declaration files don't resolve the source paths properly, causing module resolution failures in downstream app.
Repro:
- Clone https://github.com/omnidotdev/sigil and switch to https://github.com/omnidotdev/sigil/pull/157
- Run
bun run buildto trigger the build script: https://github.com/omnidotdev/sigil/blob/feature/bun-build/src/scripts/build.ts (this is where Bun bundles the library, thentsccreates the declaration files) - In downstream project, notice
ts: Module '"@omnidev/sigil"' has no exported member '[EXPORT_NAME]'.
Working tsup config that can be triggered with bunx tsup: https://github.com/omnidotdev/sigil/blob/feature/bun-build/tsup.config.ts
I'm sure I'm missing something obvious. Figured there is likely an issue with my build script or build tsconfig (https://github.com/omnidotdev/sigil/blob/feature/bun-build/tsconfig.build.json)