Skip to content

Commit

Permalink
chore(performance): prevent duplicate error messages from appearing
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLarkInn committed Dec 5, 2016
1 parent 66255df commit 5968fd0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
9 changes: 2 additions & 7 deletions lib/performance/EmittedAssetSizeLimitPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ EmittedAssetSizeLimitPlugin.prototype.apply = function(compiler) {
sizeLimit
)
);

if(!hasAsyncChunks) {
warnings.push(new NoAsyncChunksWarning());
}
}
if(entrypointsOverLimit.length > 0) {
warnings.push(
Expand All @@ -85,14 +81,13 @@ EmittedAssetSizeLimitPlugin.prototype.apply = function(compiler) {
entrypointSizeLimit
)
);
}

if(warnings.length > 0) {
if(!hasAsyncChunks) {
warnings.push(new NoAsyncChunksWarning());
}

}

if(warnings.length > 0) {
if(shouldErrorOnHint) {
Array.prototype.push.apply(compilation.errors, warnings);
} else {
Expand Down
4 changes: 2 additions & 2 deletions test/statsCases/color-enabled-custom/expected.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Hash: <CLR=BOLD>6c781fe6bf412ba6435b</CLR>
Time: <CLR=BOLD>X</CLR>ms
<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>
<CLR=32>main.js</CLR> 2.43 kB <CLR=BOLD>0</CLR> <CLR=32>[emitted]</CLR> main
<CLR=32>main.js</CLR> 2.51 kB <CLR=BOLD>0</CLR> <CLR=32>[emitted]</CLR> main
chunk {<CLR=33>0</CLR>} <CLR=32>main.js</CLR> (main) 0 bytes<CLR=33> [entry]</CLR><CLR=32> [rendered]</CLR>
[0] <CLR=BOLD>(webpack)/test/statsCases/color-enabled-custom/index.js</CLR> 0 bytes {<CLR=33>0</CLR>}<CLR=32> [built]</CLR>
[0] <CLR=BOLD>(webpack)/test/statsCases/color-enabled-custom/index.js</CLR> 0 bytes {<CLR=33>0</CLR>}<CLR=32> [built]</CLR>
4 changes: 2 additions & 2 deletions test/statsCases/color-enabled/expected.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Hash: <CLR=BOLD>6c781fe6bf412ba6435b</CLR>
Time: <CLR=BOLD>X</CLR>ms
<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>
<CLR=32,BOLD>main.js</CLR> 2.43 kB <CLR=BOLD>0</CLR> <CLR=32,BOLD>[emitted]</CLR> main
<CLR=32,BOLD>main.js</CLR> 2.51 kB <CLR=BOLD>0</CLR> <CLR=32,BOLD>[emitted]</CLR> main
chunk {<CLR=33,BOLD>0</CLR>} <CLR=32,BOLD>main.js</CLR> (main) 0 bytes<CLR=33,BOLD> [entry]</CLR><CLR=32,BOLD> [rendered]</CLR>
[0] <CLR=BOLD>(webpack)/test/statsCases/color-enabled/index.js</CLR> 0 bytes {<CLR=33,BOLD>0</CLR>}<CLR=32,BOLD> [built]</CLR>
[0] <CLR=BOLD>(webpack)/test/statsCases/color-enabled/index.js</CLR> 0 bytes {<CLR=33,BOLD>0</CLR>}<CLR=32,BOLD> [built]</CLR>
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ This can impact web performance.
Assets:
main.js (303 kB)</CLR>

<CLR=33,BOLD>WARNING in webpack performance recommendations:
You can limit the size of your bundles by using System.import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/</CLR>

<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.
Entrypoints:
main (303 kB)
Expand Down

0 comments on commit 5968fd0

Please sign in to comment.