bun build
ignores import aliases (@/
) when marking packages as external
#16509
Labels
bug
Something isn't working
bundler
Something to do with the bundler
confirmed bug
We can reproduce this issue
What version of Bun is running?
1.1.45+196621f25
What platform is your computer?
Linux 6.12.9-200.fc41.x86_64 x86_64 unknown
What steps can reproduce the bug?
📝 Description
When using
Bun.build()
withpackages: "external"
, import aliases (e.g.,@/
) are incorrectly treated as external dependencies instead of being bundled. This causes build errors when the alias is expected to be resolved within the project.🔄 Steps to Reproduce
1️⃣ Build Configuration (
build.ts
)2️⃣ Source File Before Build (
index.ts
)3️⃣ Output After Build (
index.js
)Would appreciate any guidance or confirmation if this is intended behavior! 🚀
What is the expected behavior?
❗ Expected Behavior
path
) should remain external ✅"./notAliasModule"
) should be bundled ✅@/
) should also be bundled, just like relative imports. However, they are being incorrectly marked as external ❌What do you see instead?
🏷️ Suggested Fix
Bun.build()
, even whenpackages: "external"
is specified.Additional information
No response
The text was updated successfully, but these errors were encountered: