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

Tree shaking - a shallow process #5654

Closed
Andarist opened this issue Sep 9, 2017 · 1 comment
Closed

Tree shaking - a shallow process #5654

Andarist opened this issue Sep 9, 2017 · 1 comment

Comments

@Andarist
Copy link

Andarist commented Sep 9, 2017

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

If tree-shaken module imports other modules, those other modules stay in the bundle (although not used by anything else). It indicates that tree-shaking is currently a shallow process and doesnt tree-shake unused imports in the unused modules.

If the current behavior is a bug, please provide the steps to reproduce.

https://github.com/Andarist/shallow-tree-shaking-demo

What is the expected behavior?

Tree-shaking of unused imports in unused modules. In the reproduced repository only add module should get included and mult should get tree shaken, because its used only by unused pow.

More detailed information an be found here

If this is a feature request, what is motivation or use case for changing the behavior?

n/a

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

latest node, latest webpack

@Andarist
Copy link
Author

Supposedly this is going to be fixed in webpack 5 - according to this:
https://github.com/webpack/changelog-v5/blob/73dfcf897d687a74cedd74f70c5cb68dbbed5109/README.md#inner-module-tree-shaking

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

No branches or pull requests

1 participant