Skip to content

Commit

Permalink
Fix docs for printFileSizesAfterBuild (#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 JohnNilsson committed Sep 9, 2017
1 parent da055d6 commit 152ef9b
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 152ef9b

Please sign in to comment.