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

Allow all chunks to be minimized, closes #93 #156

Closed
wants to merge 1 commit into from

Conversation

Grundik
Copy link

@Grundik Grundik commented Feb 19, 2021

Simple patch to allow all chunks to be processed. Fixes #93.

@ChadKillingsworth
Copy link
Member

That check is in place for a reason. If you have code not being minified but removing that check "fixes" it, it means that you somehow have a chunk that is not discoverable from an entry chunk.

This very well could be true. It's difficult to adapt webpack's chunk graph to a closure compiler graph.

Without an analysis of "why" this is true, the only other thing would be to keep track of any chunk and add it back at the end.

@Grundik
Copy link
Author

Grundik commented Feb 21, 2021

As you can see in provided example in referenced issue, such chunks are result of SplitChunks plugin. They dont and cant have own entry point, they are split off from some base chunk with its entry point.

Maybe there are a better check to detect such splitted-off chunks, or its better to add an option to process all chunks regardless of their entrypoints. But current blunt check for entrypoint makes this plugin practically useless: SplitChunks are de-facto mandatory for any large code base project, and processing only "main" chunk is not an option.

And its a shame, that such negligible issue makes whole plugin unusable, since this plugin are really good.

@ChadKillingsworth
Copy link
Member

I can't accept this pr in its current form. I am very familiar with the splitchunks plug in and it's effects.

As you can see in provided example in referenced issue, such chunks are result of SplitChunks plugin. They dont and cant have own entry point, they are split off from some base chunk with its entry point.

These chunks still have a relationship to their original chunk. What needs to occur is to step through the code and draw out the chunk graph with the relationships. This sounds like a sibling relationship to an entry point. The recursive traversal would need adjusted to recognize this case and add the chunk appropriately.

@Grundik
Copy link
Author

Grundik commented Feb 21, 2021

First of all, thanks for developing such plugin. I've fixed two-years-old issue, it works for me, and Im happy. Anyone with such issue (probably almost anyone who would try to use this plugin) are now able to find and apply solution.

You could offer another solution, or you could just close this PR and continue to ignore the problem. Obviously I would be more happier if vanilla version would not have such issue, and there will be no need to keep forked version, but I can live with that. This PR are mostly for your attention.

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 this pull request may close these issues.

Chunks are not processed
2 participants