-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Exports moved unexpectedly with preserveModules #3534
Comments
|
In general as for |
In this case I was using Is there a better way to create placeholders? In the end I changed my placeholder to |
If you want to leave tree-shaking on, a call to an unknown global seems like a good choice for a side-effect to me for now. Though as the return value is not used, there is again no reason to keep the export even if it is retained for now. The safest way would be to either promote all such modules to entry chunks or use |
Thinking about it, |
Boom! Yes, that works perfectly. I guess you're sharing that 'namespace' with browser things and other plugins, but the same goes for globals. |
Although, one substantial gotcha of using |
@jakearchibald I still hope to tackle this issue rather soon. There is just one other big refactoring I want to do first which is moving the chunking from the build to the output generation phase. The reason is that this makes many things a lot easier as it allows to safely store transient state on the chunks without influencing other outputs. As for this issue, there is now actually a fix: #3550 |
Input
index.js
lib.js
Expected Behavior
SOME_VARIABLE
andSOME_OTHER_VARIABLE
remain withinlib.js
.Actual Behavior
index.js
This change happened after updating from Rollup 2.2.0. In 2.2.0 it behaves as expected, but I'm not sure exactly which version introduced the behaviour change.
This transform feels like it violates
preserveModules
.The text was updated successfully, but these errors were encountered: