-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Make it easier to access contents of emitted assets #9299
Comments
The The key in |
But it probably makes sense to add a Hook which allows to introspect the in-memory file content just after it was emitted to measure i. e. gzip size, etc. You could add a hook just before this line Line 400 in 75c340c
i. e. and similar here Line 415 in 75c340c
|
Send a PR |
@sokra I would take this up 👍 |
Thanks, I meant the output path and not public path. Joining with the output path from the output options did end up working for my use case, will leave the issue open to track that enhancement. |
Feature request
What is the expected behavior?
Prior to
futureEmitAssets
being added in #8642, it was possible to easily access the final contents of all emitted assets atstats.compilation.assets
.What is motivation or use case for adding/changing the behavior?
This was useful for tracking the size of our bundled assets to avoid unintentional bundle size regressions. While
size
is still exposed onSizeOnlySource
, it's now harder to get access to the actual contents in order to track gzip/brotli/etc. size. Reading in the final emitted files from the file system would work fine but is harder than it probably should be as various plugins likeMiniCssExtractPlugin
support different public paths for different asset types.How should this be implemented in your opinion?
Including the location of the emitted asset as part of the asset stats would make things easier. Perhaps this is already available somewhere but I've been unable to find it if so.
Are you willing to work on this yourself?
Yes.
The text was updated successfully, but these errors were encountered: