Skip to content
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

Alias module deduping #3545

Open
guybedford opened this issue May 9, 2020 · 0 comments
Open

Alias module deduping #3545

guybedford opened this issue May 9, 2020 · 0 comments

Comments

@guybedford
Copy link
Contributor

guybedford commented May 9, 2020

Feature Use Case

When defining multiple alias modules as entry points, where those alias modules alias a module that is not an entry point, the aliased module is still output as a separate chunk. See the example at http://rollupjs.org/repl/?version=2.8.2&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmltcG9ydCUyMHBqc29uJTIwZnJvbSUyMCcuJTJGcGFja2FnZS5qc29uJyUzQiU1Q25jb25zb2xlLmxvZyhwanNvbiklM0IlMjIlMkMlMjJpc0VudHJ5JTIyJTNBdHJ1ZSU3RCUyQyU3QiUyMm5hbWUlMjIlM0ElMjJwYWNrYWdlLmpzb24lMjIlMkMlMjJjb2RlJTIyJTNBJTIyZXhwb3J0JTIwJTdCJTIwZGVmYXVsdCUyMCU3RCUyMGZyb20lMjAnLiUyRnBhY2thZ2UuanNvbi5qcyclM0IlMjIlMkMlMjJpc0VudHJ5JTIyJTNBdHJ1ZSU3RCUyQyU3QiUyMm5hbWUlMjIlM0ElMjJwYWNrYWdlLmpzb24uanMlMjIlMkMlMjJjb2RlJTIyJTNBJTIyZXhwb3J0JTIwZGVmYXVsdCUyMCU3QiUyMHAlM0ElMjAnanNvbiclMjAlN0QlM0IlMjIlMkMlMjJpc0VudHJ5JTIyJTNBZmFsc2UlN0QlNUQlMkMlMjJvcHRpb25zJTIyJTNBJTdCJTIyZm9ybWF0JTIyJTNBJTIyZXMlMjIlMkMlMjJuYW1lJTIyJTNBJTIybXlCdW5kbGUlMjIlMkMlMjJhbWQlMjIlM0ElN0IlMjJpZCUyMiUzQSUyMiUyMiU3RCUyQyUyMmdsb2JhbHMlMjIlM0ElN0IlN0QlN0QlMkMlMjJleGFtcGxlJTIyJTNBbnVsbCU3RA==.

Feature Proposal

When a module is fully aliased (reexported) through an entry point when that module itself is not an entry point, it should be possible to effectively treat the aliasing entry point as the primary source from a code splitting perspective, resulting in fewer separate chunks in these sorts of alias cases. A heuristic might be to make it that the first alias module in the entry point list in order becomes the primary module source by proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants