1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Add check for added/deleted pages (#4497)

This commit is contained in:
Tim Neutkens 2018-05-29 19:32:16 +02:00 committed by GitHub
parent 8cbc0be845
commit cd1a2fbd91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -190,9 +190,9 @@ export default class HotReloader {
changedPageRoutes.push(route)
}
// This means `/_app` is most likely included in the list.
// We filter it out because `/_app` will be re-rendered with the page
if (changedPageRoutes.length > 1) {
// This means `/_app` is most likely included in the list, or a page was added/deleted in this compilation run.
// This means we should filter out `/_app` because `/_app` will be re-rendered with the page reload.
if (added.size !== 0 || removed.size !== 0 || changedPageRoutes.length > 1) {
changedPageRoutes = changedPageRoutes.filter((route) => route !== '/_app' && route !== '/_document')
}