Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Polling for Bash on Windows #302

Merged
merged 2 commits into from
Nov 28, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion server/hot-reloader.js
Original file line number Diff line number Diff line change
@@ -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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add is-windows-bash to the package.json

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use absolute versions, so use that. I mean versions like 0.8.1 not ^0.8.1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh whoops, totally forgot to check that in. Will update my package to support ES5 as well.
EDIT: Done, published ES5 changes and using that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome.

import webpack from './build/webpack'
import read from './read'

Expand Down Expand Up @@ -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,
Expand All @@ -124,7 +133,8 @@ export default class HotReloader {
timings: false,
version: false,
warnings: false
}
},
...windowsSettings
})

this.webpackHotMiddleware = webpackHotMiddleware(compiler, { log: false })
Expand Down