Skip to content

Commit 5a82533

Browse files
authored
Merge pull request webpack#4402 from ornj/performance-hint-commas
Removes excess commas from performance hint output
2 parents 8778b66 + b36a8b6 commit 5a82533

6 files changed

Lines changed: 49 additions & 3 deletions

File tree

‎lib/performance/EntrypointsOverSizeLimitWarning.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ module.exports = class EntrypointsOverSizeLimitWarning extends Error {
1515
} (${
1616
SizeFormatHelpers.formatSize(entrypoint.size)
1717
})\n${
18-
entrypoint.files.map(asset => ` ${asset}\n`).join()
19-
}`).join();
18+
entrypoint.files.map(asset => ` ${asset}`).join("\n")
19+
}`).join("");
2020
this.message = `entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (${SizeFormatHelpers.formatSize(entrypointLimit)}). This can impact web performance.
21-
Entrypoints:${entrypointList}`;
21+
Entrypoints:${entrypointList}\n`;
2222
Error.captureStackTrace(this, this.constructor);
2323
}
2424
};
293 KB
Binary file not shown.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Time: <CLR=BOLD>X</CLR>ms
2+
<CLR=BOLD>Asset</CLR> <CLR=BOLD>Size</CLR> <CLR=BOLD>Chunks</CLR> <CLR=39,BOLD><CLR=22> <CLR=39,BOLD><CLR=22> <CLR=BOLD>Chunk Names</CLR>
3+
<CLR=33,BOLD>sec.js</CLR> <CLR=33,BOLD>303 kB</CLR> <CLR=BOLD>0</CLR> <CLR=32,BOLD>[emitted]</CLR> <CLR=33,BOLD>[big]</CLR> sec
4+
<CLR=33,BOLD>main.js</CLR> <CLR=33,BOLD>303 kB</CLR> <CLR=BOLD>1</CLR> <CLR=32,BOLD>[emitted]</CLR> <CLR=33,BOLD>[big]</CLR> main
5+
Entrypoint <CLR=BOLD>main</CLR> <CLR=33,BOLD>[big]</CLR> = <CLR=32,BOLD>main.js</CLR>
6+
Entrypoint <CLR=BOLD>sec</CLR> <CLR=33,BOLD>[big]</CLR> = <CLR=32,BOLD>sec.js</CLR>
7+
chunk {<CLR=33,BOLD>0</CLR>} <CLR=32,BOLD>sec.js</CLR> (sec) 300 kB<CLR=33,BOLD> [entry]</CLR><CLR=32,BOLD> [rendered]</CLR>
8+
[0] <CLR=BOLD>(webpack)/test/statsCases/performance-oversize-limit-error/a.js</CLR> 300 kB {<CLR=33,BOLD>0</CLR>} {<CLR=33,BOLD>1</CLR>}<CLR=32,BOLD> [built]</CLR>
9+
[2] <CLR=BOLD>(webpack)/test/statsCases/performance-oversize-limit-error/index2.js</CLR> 16 bytes {<CLR=33,BOLD>0</CLR>}<CLR=32,BOLD> [built]</CLR>
10+
chunk {<CLR=33,BOLD>1</CLR>} <CLR=32,BOLD>main.js</CLR> (main) 300 kB<CLR=33,BOLD> [entry]</CLR><CLR=32,BOLD> [rendered]</CLR>
11+
[0] <CLR=BOLD>(webpack)/test/statsCases/performance-oversize-limit-error/a.js</CLR> 300 kB {<CLR=33,BOLD>0</CLR>} {<CLR=33,BOLD>1</CLR>}<CLR=32,BOLD> [built]</CLR>
12+
[1] <CLR=BOLD>(webpack)/test/statsCases/performance-oversize-limit-error/index.js</CLR> 16 bytes {<CLR=33,BOLD>1</CLR>}<CLR=32,BOLD> [built]</CLR>
13+
14+
<CLR=31,BOLD>ERROR in asset size limit: The following asset(s) exceed the recommended size limit (250 kB).
15+
This can impact web performance.
16+
Assets:
17+
sec.js (303 kB)
18+
main.js (303 kB)</CLR>
19+
20+
<CLR=31,BOLD>ERROR in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (250 kB). This can impact web performance.
21+
Entrypoints:
22+
main (303 kB)
23+
main.js
24+
sec (303 kB)
25+
sec.js
26+
</CLR>
27+
28+
<CLR=31,BOLD>ERROR in webpack performance recommendations:
29+
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
30+
For more info visit https://webpack.js.org/guides/code-splitting/</CLR>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require("./a");
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require("./a");
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
entry: {
3+
main: "./index",
4+
sec: "./index2"
5+
},
6+
stats: {
7+
colors: true,
8+
hash: false,
9+
entrypoints: true
10+
},
11+
performance: {
12+
hints: "error"
13+
}
14+
};

0 commit comments

Comments
 (0)