Skip to content

Commit 032d90a

Browse files
authored
docs(readme): correct dev middleware context usage (#1485)
1 parent a2ebecc commit 032d90a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

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

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

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

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

0 commit comments

Comments
 (0)