Skip to content

Commit

Permalink
Find pages/_document.js chunk in development (#15172)
Browse files Browse the repository at this point in the history
Chunks already have a normalized path.

Not sure if there are other chunks that require this change, I did a global search and didn't find similar cases.
  • Loading branch information
lfades authored Jul 15, 2020
1 parent 29dfaf9 commit 6639b8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/next/server/hot-reloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getOverlayMiddleware } from '@next/react-dev-overlay/lib/middleware'
import { NextHandleFunction } from 'connect'
import { IncomingMessage, ServerResponse } from 'http'
import { WebpackHotMiddleware } from './hot-middleware'
import { join, normalize, relative as relativePath } from 'path'
import { join, relative as relativePath } from 'path'
import { UrlObject } from 'url'
import webpack from 'webpack'
import { createEntrypoints, createPagesMapping } from '../build/entries'
Expand Down Expand Up @@ -353,7 +353,7 @@ export default class HotReloader {
// We only watch `_document` for changes on the server compilation
// the rest of the files will be triggered by the client compilation
const documentChunk = compilation.chunks.find(
(c) => c.name === normalize(`pages/_document`)
(c) => c.name === `pages/_document`
)
// If the document chunk can't be found we do nothing
if (!documentChunk) {
Expand Down

0 comments on commit 6639b8f

Please sign in to comment.