-
-
Notifications
You must be signed in to change notification settings - Fork 27
Rollup ^3.0.0 cjs re-exports edge case with externalLiveBindings: false #79
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
Comments
Thanks for reporting. Per the policy on this project, the patterns supported were fully stabilized at the point this library started shipping, so that no new detections will be added. Otherwise that risks code that works in new Node.js versions mysteriously breaking in older versions and that would be very very difficult to debug. I've posted a PR in #80 to better explain this as part of the project status. |
/cc @lukastaegert If Node.js will no longer update the detection mechanism, maybe Rollup will have to adapt to this case? I think it comes down to the use of |
Unfortunately that basically is the situation today - where build tools do have to accept these semantics as part of their targets now. It's ended up the lesser of the evils, and my apologies we couldn't do better! |
esbuild ended up just using a hinting pattern itself - #46 |
I think the change was done to allow some level of improved ES3 compatibility via this option. But I see that this is only affecting a very minor group of users and since |
Actually, looking at this longer, it was not about ES3 compatibility. I wanted to switch to the other pattern altogether because it is smaller and more performant, but it cannot be used for live bindings because But yes, I will revert this change. |
Fix at rollup/rollup#4826 |
Thanks @lukastaegert - I will close this one now. |
This is a new version of the same problem reported back in #38
Given code
Default
cjs
output from Rollup (working, correctly detects re-exports fromfoo
):With
output.externalLiveBindings: false
(not working, no re-exports detected):Note: this was working previously in Rollup 2.x where the code generated was:
Reproduction
npm run build
(which buildssrc/index.js
with Rollup toout.js
)node lex.js
(which runscjs-module-lexer
onout.js
)The text was updated successfully, but these errors were encountered: