Skip to content

Commit

Permalink
Fix docs for printFileSizesAfterBuild (facebook#2942)
Browse files Browse the repository at this point in the history
* Fix docs for `printFileSizesAfterBuild`

* Add optionals parameters for `printFileSizesAfterBuild`
  • Loading branch information
Kerumen authored and thongdong7 committed Sep 24, 2017
1 parent 931074c commit 7511411
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/react-dev-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ 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, maxBundleGzipSize?: number, maxChunkGzipSize?: number)`

Prints the JS and CSS asset sizes after the build, and includes a size comparison with `previousFileSizes` that were captured earlier using `measureFileSizesBeforeBuild()`.
Prints the JS and CSS asset sizes after the build, and includes a size comparison with `previousFileSizes` that were captured earlier using `measureFileSizesBeforeBuild()`. `maxBundleGzipSize` and `maxChunkGzipSizemay` may optionally be specified to display a warning when the main bundle or a chunk exceeds the specified size (in bytes).

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

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

0 comments on commit 7511411

Please sign in to comment.