Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix docs for printFileSizesAfterBuild
  • Loading branch information
Kerumen authored Aug 11, 2017
commit 7c907c6dfbb83fa6049114331475bbed50cba831
4 changes: 2 additions & 2 deletions packages/react-dev-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ module: {

Captures JS and CSS asset sizes inside the passed `buildFolder`. Save the result value to compare it after the build.

##### `printFileSizesAfterBuild(webpackStats: WebpackStats, previousFileSizes: OpaqueFileSizes)`
##### `printFileSizesAfterBuild(webpackStats: WebpackStats, previousFileSizes: OpaqueFileSizes, buildFolder: string)`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Can you also add maxBundleGzipSize and maxChunkGzipSize as optional fields?

maxBundleGzipSize?: number, maxChunkGzipSize?: number

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes sorry! It's a long week-end here in France (day off) but I do it right when I come back, tonight.

Do you want me to add another phrase to describe the new arguments or I add this in the signature only?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! A sentence explaining both would be great.

Maybe something like:

maxBundleGzipSize and maxChunkGzipSizemay optionally be specified to display a warning when the main bundle or a chunk exceeds the specified size (in bytes).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Timer Done! Sorry for the delay :/


Prints the JS and CSS asset sizes after the build, and includes a size comparison with `previousFileSizes` that were captured earlier using `measureFileSizesBeforeBuild()`.

Expand All @@ -182,7 +182,7 @@ var {

measureFileSizesBeforeBuild(buildFolder).then(previousFileSizes => {
return cleanAndRebuild().then(webpackStats => {
printFileSizesAfterBuild(webpackStats, previousFileSizes);
printFileSizesAfterBuild(webpackStats, previousFileSizes, buildFolder);
});
});
```
Expand Down