-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Chunk information in missing for compressed files #185
Comments
You should use |
But for webpack@4, you need to put own plugin after |
Doesn't look fixed in v4 or v5, getting below output, see Output of To fix this, chunks object need to be updated to have new asset name as well. i.e. I will send a PR to address this. |
What do you mean What is webpack version? |
It is asset, so we don't know is this |
Webpack version is 5. See the Due to the gzipped file not present in this chunk's file array, webpack's stat generation logic(L260) thinks that gzipped file has no chunks, and outputs |
Because |
If |
You are right, |
|
@xitter in this case |
Including this can make other plugins' life easy to see the correct stat info. See discussion on webpack-contrib/webpack-bundle-analyzer#377 (comment) |
@xitter Why do not use |
Let's open to find the most suitable and convenient solution to the problem |
@evilebottnawi I see 2 issues with
So I see 2 solutions: A. Add a The only caveat with A is that other plugins have to be aware of |
No, we can't because the
webpack already generate stats in right way, compressed assets is not chunk, it is asset as I written above
Why do not improve logic? It should be very easy, just check asset info. |
@xitter friendly ping |
If the asset is deleted(with |
@xitter I don't understand your problem, please clarify |
Below is the stat information for config:
Stats:
This has the assetInfo as you mentioned. However, if we use
Here, this assetInfo can not be used to map chunks as chunks are referring to |
Just improve this, add additional check in your code, if you need we can added |
@xitter friendly ping |
Closing due to inactivity. Thanks! |
When a compressed file is emitted, the chunks do not get updated. i.e. for a
test.js
file, chunk information looks like:Due to this issue, the final stats in thee done hook, do not map chunks to compressed assets.
Expected Behavior
As a new compressed asset is being added, chunks should also have reference to this new asset, like:
Actual Behavior
Code
Webpack config used:
How Do We Reproduce?
Try out the above config and check the stats in
done
hook like:The text was updated successfully, but these errors were encountered: