Skip to content

Commit d63a569

Browse files
authored
docs: fix outputFileSystem and stats usage (#1113)
* docs: fix `outputFileSystem` usage * docs: fix `stats` usage
1 parent 2848c9d commit d63a569

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ In order to develop an app using server-side rendering, we need access to the
397397
[`stats`](https://github.com/webpack/docs/wiki/node.js-api#stats), which is
398398
generated with each build.
399399

400-
With server-side rendering enabled, `webpack-dev-middleware` sets the `stats` to `res.locals.webpack.devMiddleware.stats`
401-
and the filesystem to `res.locals.webpack.devMiddleware.outputFileSystem` before invoking the next middleware,
400+
With server-side rendering enabled, `webpack-dev-middleware` sets the `stats` to `res.locals.webpack.devMiddleware.context.stats`
401+
and the filesystem to `res.locals.webpack.devMiddleware.context.outputFileSystem` before invoking the next middleware,
402402
allowing a developer to render the page body and manage the response to clients.
403403

404404
_Note: Requests for bundle files will still be handled by
@@ -432,8 +432,8 @@ app.use(middleware(compiler, { serverSideRender: true }));
432432
// The following middleware would not be invoked until the latest build is finished.
433433
app.use((req, res) => {
434434
const { devMiddleware } = res.locals.webpack;
435-
const outputFileSystem = devMiddleware.outputFileSystem;
436-
const jsonWebpackStats = devMiddleware.stats.toJson();
435+
const outputFileSystem = devMiddleware.context.outputFileSystem;
436+
const jsonWebpackStats = devMiddleware.context.stats.toJson();
437437
const { assetsByChunkName, outputPath } = jsonWebpackStats;
438438

439439
// Then use `assetsByChunkName` for server-side rendering

0 commit comments

Comments
 (0)