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
Is there a way to change rename order when exist duplicate names? #3975
Comments
This is not possible and I am not sure it is useful to make it configurable as this may raise expectations that names could be predictable, which I want to avoid. But if I understand you correctly, you think it is better that e.g. names in entry points should be retained as opposed names in dependencies. The rationale would be that could further down the execution order is more likely to be written by the user. So from this perspective, we could just change the order in which we deconflict variables to use reverse execution order instead of execution order. Do you agree? |
@lukastaegert yeah. Thanks for reply. That's just what I need. I want to retain names in entry points as it may do additional things with the same name in dependencies.
Could you give an example? |
I created a fix in #3977. This is the situation without the fix: And this is what you get using the fix: |
Perfect, thanks very much! |
Feature Use Case
//a.js
//main.js
// bundle out,js
When there are duplicate names, it will rename the variable from inner module to outer.
Is there a way to reverse the rename order? or add a custom config to support that?
// expect out.js
Feature Proposal
The text was updated successfully, but these errors were encountered: