-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESBuild doesn't preserve export *
from externalized packages consistently
#1737
Comments
FWIW, this still repros @ 0.14.13. |
I don't understand why |
Looks like files including import_star has been considered commonjs: esbuild/internal/bundler/linker.go Lines 1249 to 1253 in ed341b0
|
Any movement on this? It's currently a full blocker on me moving to Vite. |
@evanw This is fairly easy to repro, and we are still working around this when we hit it. Basically it's very hard to prevent this from happening if you're bundling things that you don't control (like vendor packages.) Any way to prioritize fixing this one? |
How can we make sure we avoid a 3 year anniversary to this issue? It's pretty annoying... |
Just ran into this issue as well. What's going on here? |
I'm re-opening this due to getting buried and also because esbuild is producing fundamentally broken output. This could use some eyes.
Setup:
index.js
:utilities.js
:Now create an esm bundle:
Expected:
Resulted:
This makes the bundle unusable in the browser; while I believe star exports are far more fragile than named exports when exporting from an external, it's still completely valid. When encountered, esbuild produces unusable results.
This problem does not repro if the
export * from 'foo'
is in the entry point (index.js
) rather than the sub file (utilities.js
).The text was updated successfully, but these errors were encountered: