-
-
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
fix: module assets is in buildInfo #6640
Conversation
Could you add some tests in |
@ooflorent I will have a try 😄 |
[1] ./node_modules/a/index.js 17 bytes {0} [built] | ||
chunk {1} main.js (main) 12 bytes >{0}< [entry] [rendered] | ||
[2] ./index.js 12 bytes {1} [built] | ||
[0] ./node_modules/a/1.png 82 bytes {0} [built] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assets
info isn't in the stats string output. It's only in the stats json.
Maybe you can expand this PR a bit and add support for showing emitted files in the Stats.
I could image a small flag like this:
[0] ./node_modules/a/1.png 82 bytes {0} [built] [1 asset]
You also need include a flag moduleAssets
to show/hide this information. It should be enabled by default in json output but disabled by default for toString, so it's backward-compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sokra
Sure, I will try to work on int.
@sokra Please review the my changes 😸. |
5a6a98d
to
957b62c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
lib/Stats.js
Outdated
@@ -867,6 +873,9 @@ class Stats { | |||
if (module.built) { | |||
colors.green(" [built]"); | |||
} | |||
if (module.assets && module.assets.length) { | |||
colors.magenta(` [${module.assets.length} asset]`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for module.assets.length > 1
it should be assets instead of asset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sokra
Thank you for the review, I have changed it.
I think it's better to extract module.assets.length
into a variable such as const assetsSize = module.assets.length
, but for keeping the same behavior with other sources(module.warnings, module.errors
), I directly used module.assets.length
.
@sokra And about the PR Quality Review, codes have been prettied by |
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
Thanks |
What kind of change does this PR introduce?
bugfix
Did you add tests for your changes?
Summary
module.assets
should bemodule.buildInfo.assets
due to #6111Does this PR introduce a breaking change?
No
Other information