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

use webpack/hot/dev-server to full-reload on HMR errors

This commit is contained in:
nkzawa 2016-10-25 22:51:44 +09:00
parent 165431bdc7
commit a9c0ae3498

View file

@ -13,7 +13,7 @@ export default async function createCompiler (dir, { hotReload = false } = {}) {
const pages = await glob('pages/**/*.js', { cwd: dir })
const entry = {}
const defaultEntries = hotReload ? ['webpack/hot/only-dev-server'] : []
const defaultEntries = hotReload ? ['webpack/hot/dev-server'] : []
for (const p of pages) {
entry[join('bundles', p)] = defaultEntries.concat(['./' + p])
}