mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Add Polling for Bash on Windows (#302)
* Add Polling for Bash on Windows Fixes #166 * Add Windows Bash Dependency
This commit is contained in:
parent
10b815b9c9
commit
7a66870af9
|
@ -46,6 +46,7 @@
|
|||
"glamor": "2.18.2",
|
||||
"glob-promise": "2.0.0",
|
||||
"htmlescape": "1.1.1",
|
||||
"is-windows-bash": "1.0.1",
|
||||
"json-loader": "0.5.4",
|
||||
"loader-utils": "0.2.16",
|
||||
"minimist": "1.2.0",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { join, relative, sep } from 'path'
|
||||
import webpackDevMiddleware from 'webpack-dev-middleware'
|
||||
import webpackHotMiddleware from 'webpack-hot-middleware'
|
||||
import isWindowsBash from 'is-windows-bash'
|
||||
import webpack from './build/webpack'
|
||||
import read from './read'
|
||||
|
||||
|
@ -106,6 +107,14 @@ export default class HotReloader {
|
|||
this.prevChunkHashes = chunkHashes
|
||||
})
|
||||
|
||||
const windowsSettings = isWindowsBash() ? {
|
||||
lazy: false,
|
||||
watchOptions: {
|
||||
aggregateTimeout: 300,
|
||||
poll: true
|
||||
}
|
||||
} : {}
|
||||
|
||||
this.webpackDevMiddleware = webpackDevMiddleware(compiler, {
|
||||
publicPath: '/_webpack/',
|
||||
noInfo: true,
|
||||
|
@ -124,7 +133,8 @@ export default class HotReloader {
|
|||
timings: false,
|
||||
version: false,
|
||||
warnings: false
|
||||
}
|
||||
},
|
||||
...windowsSettings
|
||||
})
|
||||
|
||||
this.webpackHotMiddleware = webpackHotMiddleware(compiler, { log: false })
|
||||
|
|
Loading…
Reference in a new issue