Unverified Commit 597fc331 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

serverOnlyChanges should be determined when both compilers are done (#29757)

parent bdfc4c2e
...@@ -494,22 +494,6 @@ export default class HotReloader { ...@@ -494,22 +494,6 @@ export default class HotReloader {
this.serverError = null this.serverError = null
this.serverStats = stats this.serverStats = stats
const serverOnlyChanges = difference<string>(
changedServerPages,
changedClientPages
)
changedClientPages.clear()
changedServerPages.clear()
if (serverOnlyChanges.length > 0) {
this.send({
event: 'serverOnlyChanges',
pages: serverOnlyChanges.map((pg) =>
denormalizePagePath(pg.substr('pages'.length))
),
})
}
const { compilation } = stats const { compilation } = stats
// We only watch `_document` for changes on the server compilation // We only watch `_document` for changes on the server compilation
...@@ -537,6 +521,23 @@ export default class HotReloader { ...@@ -537,6 +521,23 @@ export default class HotReloader {
this.serverPrevDocumentHash = documentChunk.hash this.serverPrevDocumentHash = documentChunk.hash
} }
) )
multiCompiler.hooks.done.tap('NextjsHotReloaderForServer', () => {
const serverOnlyChanges = difference<string>(
changedServerPages,
changedClientPages
)
changedClientPages.clear()
changedServerPages.clear()
if (serverOnlyChanges.length > 0) {
this.send({
event: 'serverOnlyChanges',
pages: serverOnlyChanges.map((pg) =>
denormalizePagePath(pg.substr('pages'.length))
),
})
}
})
multiCompiler.compilers[0].hooks.failed.tap( multiCompiler.compilers[0].hooks.failed.tap(
'NextjsHotReloaderForClient', 'NextjsHotReloaderForClient',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment