Skip to content

Commit 9894b58

Browse files
TheLarkInnsokra
authored andcommitted
fix(performance): modified values to 250kb across the board for accurate reporting, modified string logic
1 parent 1db0e1a commit 9894b58

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

lib/WebpackOptionsDefaulter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ function WebpackOptionsDefaulter() {
1313
this.set("context", process.cwd());
1414
this.set("target", "web");
1515

16-
this.set("performance.maxInitialChunkSize", 100000);
17-
this.set("performance.maxAssetSize", 300000);
16+
this.set("performance.maxAssetSize", 250000);
17+
this.set("performance.maxInitialChunkSize", 250000);
1818
this.set("performance.hints", true);
1919
this.set("performance.errorOnHint", false);
2020

lib/performance/AssetsOverSizeLimitWarning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function AssetsOverSizeLimitWarning(assetsOverSizeLimit, compilation, formatSize
1313
return "\n " + asset.name;
1414
}).join("");
1515

16-
this.message = "asset size limit: The following assets exceed the recommended size limit (" + formatSize(assetLimit).number + " kB). \n" +
16+
this.message = "asset size limit: The following assets exceed the recommended size limit (" + formatSize(assetLimit).string + "). \n" +
1717
"This can impact web performance.\n" +
1818
"Assets: " + assetLists;
1919
}

lib/performance/EntrypointsOverSizeLimitWarning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function EntrypointsOverSizeLimitWarning(entrypoints, compilation, formatSizeFn,
1717
}).join("");
1818
}).join("");
1919

20-
this.message = "entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (" + entrypointLimit + " kB). " +
20+
this.message = "entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (" + formatSize(entrypointLimit).string + "). " +
2121
"This can impact web performance.\n" +
2222
"Entrypoints: \n" +
2323
entrypointList;

test/statsCases/performance-error/expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ chunk {<CLR=33,BOLD>3</CLR>} <CLR=32,BOLD>main.js</CLR> (main) 540 kB<CLR=33,
1818
[3] <CLR=BOLD>(webpack)/test/statsCases/performance-error/a.js</CLR> 22 bytes {<CLR=33,BOLD>3</CLR>}<CLR=32,BOLD> [built]</CLR>
1919
[8] <CLR=BOLD>(webpack)/test/statsCases/performance-error/index.js</CLR> 93 bytes {<CLR=33,BOLD>3</CLR>}<CLR=32,BOLD> [built]</CLR>
2020

21-
<CLR=31,BOLD>ERROR in asset size limit: The following assets exceed the recommended size limit (300 kB).
21+
<CLR=31,BOLD>ERROR in asset size limit: The following assets exceed the recommended size limit (250 kB).
2222
This can impact web performance.
2323
Assets:
2424
main.js</CLR>
2525

26-
<CLR=31,BOLD>ERROR in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (300 kB). This can impact web performance.
26+
<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.
2727
Entrypoints:
2828

2929
main: 546 kB

test/statsCases/preset-normal-performance/expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ chunk {<CLR=33,BOLD>3</CLR>} <CLR=32,BOLD>main.js</CLR> (main) 540 kB<CLR=33,
1818
[3] <CLR=BOLD>(webpack)/test/statsCases/preset-normal-performance/a.js</CLR> 22 bytes {<CLR=33,BOLD>3</CLR>}<CLR=32,BOLD> [built]</CLR>
1919
[8] <CLR=BOLD>(webpack)/test/statsCases/preset-normal-performance/index.js</CLR> 93 bytes {<CLR=33,BOLD>3</CLR>}<CLR=32,BOLD> [built]</CLR>
2020

21-
<CLR=33,BOLD>WARNING in asset size limit: The following assets exceed the recommended size limit (300 kB).
21+
<CLR=33,BOLD>WARNING in asset size limit: The following assets exceed the recommended size limit (250 kB).
2222
This can impact web performance.
2323
Assets:
2424
main.js</CLR>
2525

26-
<CLR=33,BOLD>WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (300 kB). This can impact web performance.
26+
<CLR=33,BOLD>WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (250 kB). This can impact web performance.
2727
Entrypoints:
2828

2929
main: 546 kB

0 commit comments

Comments
 (0)