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

Suggestion: Use tree-shaking information when generating third party dependencies #380

Closed
lukastaegert opened this issue Jun 8, 2019 · 5 comments · Fixed by #384
Closed

Comments

@lukastaegert
Copy link
Contributor

At the moment, this plugin will list all imported dependencies in the license file even though I may not be using any code from those dependencies due to tree-shaking.

This could be improved substantially by not relying on the load hook to identify dependencies but instead by using the bundle information in generateBundle, which lists for each chunk the module ids included in the chunk + the rendered length (which should be 0 for tree-shaken modules).

@lukastaegert lukastaegert changed the title Use tree-shaking information when generating third party dependencies Suggestion: Use tree-shaking information when generating third party dependencies Jun 8, 2019
@mjeanroy
Copy link
Owner

Hi @lukastaegert,
Thanks for the report.
You're totally right, the license should be excluded if the dependency does not appear in the final bundle. I suppose the idea here is to use the modules entry in the ChunkInfo parameter, right?

@mjeanroy
Copy link
Owner

@lukastaegert I opened a pull request for this, if you few minutes to take a look and tell me if I missed something ;)

@lukastaegert
Copy link
Contributor Author

I can take a look this evening, thanks for being responsive to this!

@lukastaegert
Copy link
Contributor Author

Ok, did it right away, thanks!

@mjeanroy
Copy link
Owner

mjeanroy commented Aug 1, 2019

Hi,
Version 0.10.0 has been published with this feature.

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

Successfully merging a pull request may close this issue.

2 participants