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
map/filter/reduce on constant arrays with property access isn't treeshaken #5421
Comments
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rollup Version
v4.0.2
Operating System (or Browser)
n/a
Node Version (if applicable)
No response
Link To Reproduction
https://rollupjs.org/repl/?version=4.0.2&shareable=JTdCJTIyZXhhbXBsZSUyMiUzQW51bGwlMkMlMjJtb2R1bGVzJTIyJTNBJTVCJTdCJTIyY29kZSUyMiUzQSUyMmltcG9ydCUyMCcuJTJGdGVzdC5qcyclM0IlNUNuJTIyJTJDJTIyaXNFbnRyeSUyMiUzQXRydWUlMkMlMjJuYW1lJTIyJTNBJTIybWFpbi5qcyUyMiU3RCUyQyU3QiUyMmNvZGUlMjIlM0ElMjJleHBvcnQlMjBjb25zdCUyMGElMjAlM0QlMjAlNUInZm9vJyU1RC5tYXAocyUyMCUzRCUzRSUyMHMlNUIwJTVEKSU1Q25leHBvcnQlMjBjb25zdCUyMGIlMjAlM0QlMjAlNUInZm9vJyU1RC5maWx0ZXIocyUyMCUzRCUzRSUyMHMlNUIwJTVEJTIwJTNEJTNEJTNEJTIwJ2QnKSU1Q25leHBvcnQlMjBjb25zdCUyMGMlMjAlM0QlMjAlNUInZm9vJyU1RC5yZWR1Y2UoKGElMkMlMjBzKSUyMCUzRCUzRSUyMGElMjAlMkIlMjBzLmxlbmd0aCUyQyUyMDApJTIyJTJDJTIyaXNFbnRyeSUyMiUzQWZhbHNlJTJDJTIybmFtZSUyMiUzQSUyMnRlc3QuanMlMjIlN0QlNUQlMkMlMjJvcHRpb25zJTIyJTNBJTdCJTIyb3V0cHV0JTIyJTNBJTdCJTIyZm9ybWF0JTIyJTNBJTIyZXMlMjIlN0QlMkMlMjJ0cmVlc2hha2UlMjIlM0F0cnVlJTdEJTdE
Expected Behaviour
the export is stripped away
Actual Behaviour
it is not stripped.
i believe this is happening due to rollup not being able to determine the type of the argument, since similar exports are all correctly stripped in all these cases:
The text was updated successfully, but these errors were encountered: