fix(commonjs): resolve export "exports" not found#1363
Conversation
shellscape
left a comment
There was a problem hiding this comment.
Feel free to merge 🎉
|
Currently thinking about this, maybe I know a solution that is even more CommonJS spec compliant, let me check. Will convert it to draft for a moment. |
|
Turns out my other idea did not really work out. As I already got the go for this, I will merge this one now. |
|
@lukastaegert would you consider merging a patch to replace |
|
The code in question is theoretically included for every single CommonJS module. Using |
|
Yes, that’s our coping strategy for the time being. Thanks! |
This reverts commit 39a39d7.
Rollup Plugin Name:
commonjsThis PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
Description
Previously, this plugin relied on "synthetic named exports" to get a reference for the
module.exportsexport of a module in a way that would update ifmodule.exportsis reassigned.This apparently caused issues, so this PR changes that to instead use a getter and setter that updates
exportsifmodule.exportsis reassigned.