diff --git a/server/hot-reloader.js b/server/hot-reloader.js index b7c09a41..7b00ce06 100644 --- a/server/hot-reloader.js +++ b/server/hot-reloader.js @@ -7,6 +7,8 @@ import webpack from './build/webpack' import clean from './build/clean' import getConfig from './config' +const isBundledPage = /^bundles[/\\]pages.*\.js$/ + export default class HotReloader { constructor (dir, { quiet, conf } = {}) { this.dir = dir @@ -78,7 +80,12 @@ export default class HotReloader { compiler.plugin('done', (stats) => { const { compilation } = stats - const chunkNames = new Set(compilation.chunks.map((c) => c.name)) + const chunkNames = new Set( + compilation.chunks + .map((c) => c.name) + .filter(name => isBundledPage.test(name)) + ) + const failedChunkNames = new Set(compilation.errors .map((e) => e.module.reasons) .reduce((a, b) => a.concat(b), []) @@ -86,7 +93,11 @@ export default class HotReloader { .reduce((a, b) => a.concat(b), []) .map((c) => c.name)) - const chunkHashes = new Map(compilation.chunks.map((c) => [c.name, c.hash])) + const chunkHashes = new Map( + compilation.chunks + .filter(c => isBundledPage.test(c.name)) + .map((c) => [c.name, c.hash]) + ) if (this.initialized) { // detect chunks which have to be replaced with a new template