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
preserveModules
caused some unnecessary import and export.
#4698
Comments
I agree about the unnecessary export in the second bar case. I remember, though, that it was not completely trivial to figure out if it was really needed. In the first foo case, the output is actually completely equivalent. It is more verbose, though, which is also not nice. Here is one thing we could try: When generating exports/re-exports, we could check if a re-exported binding is already imported as some name in a module and in that case, write it as a regular export of that name. That would "solve" both issues together. |
@lukastaegert I wonder if |
It depends if we also have similar issues with the other formats that support code-splitting, i.e. cjs, amd, and system. I cannot check at the moment. If that is the case, it might be better to solve the issue in |
This issue has been resolved via #4759 as part of rollup@3.8.0. You can test it via |
Rollup Version
3.2.5
Operating System (or Browser)
macOS 12.6
Node Version (if applicable)
18.9.0
Link To Reproduction
https://github.com/imzue/rollup-preserve-modules-issue-report
Expected Behaviour
Source
Expected
Actual Behaviour
AND
The text was updated successfully, but these errors were encountered: