Skip to content
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 docs for printFileSizesAfterBuild #2942

Merged
merged 2 commits into from
Aug 16, 2017
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
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