Skip to content

Commit b4d3969

Browse files
Kerumenthongdong7
authored andcommitted
Fix docs for printFileSizesAfterBuild (facebook#2942)
* Fix docs for `printFileSizesAfterBuild` * Add optionals parameters for `printFileSizesAfterBuild`
1 parent cb91a9c commit b4d3969

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react-dev-utils/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ module: {
170170

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

173-
##### `printFileSizesAfterBuild(webpackStats: WebpackStats, previousFileSizes: OpaqueFileSizes)`
173+
##### `printFileSizesAfterBuild(webpackStats: WebpackStats, previousFileSizes: OpaqueFileSizes, buildFolder: string, maxBundleGzipSize?: number, maxChunkGzipSize?: number)`
174174

175-
Prints the JS and CSS asset sizes after the build, and includes a size comparison with `previousFileSizes` that were captured earlier using `measureFileSizesBeforeBuild()`.
175+
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).
176176

177177
```js
178178
var {
@@ -182,7 +182,7 @@ var {
182182

183183
measureFileSizesBeforeBuild(buildFolder).then(previousFileSizes => {
184184
return cleanAndRebuild().then(webpackStats => {
185-
printFileSizesAfterBuild(webpackStats, previousFileSizes);
185+
printFileSizesAfterBuild(webpackStats, previousFileSizes, buildFolder);
186186
});
187187
});
188188
```

0 commit comments

Comments
 (0)