Skip to content

Commit 67a94fb

Browse files
Merge pull request #3154 from t27duck/live_reload_configurable
Allow liveReload to be configurable in dev server
2 parents 540b04d + 99595f3 commit 67a94fb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/install/config/webpacker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ development:
2626
port: 3035
2727
# Hot Module Replacement updates modules while the application is running without a full reload
2828
hmr: false
29+
# Defaults to the inverse of hmr. Uncomment to manually set this.
30+
# live_reload: true
2931
client:
3032
# Should we show a full-screen overlay in the browser when there are compiler errors or warnings?
3133
overlay: true

package/environments/development.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ let devConfig = {
1212
}
1313

1414
if (runningWebpackDevServer) {
15+
let liveReload = !devServer.hmr
16+
if (devServer.live_reload !== undefined) {
17+
liveReload = devServer.live_reload
18+
}
19+
1520
const devServerConfig = {
1621
devMiddleware: {
1722
publicPath
@@ -22,7 +27,7 @@ if (runningWebpackDevServer) {
2227
port: devServer.port,
2328
https: devServer.https,
2429
hot: devServer.hmr,
25-
liveReload: !devServer.hmr,
30+
liveReload,
2631
historyApiFallback: { disableDotRule: true },
2732
headers: devServer.headers,
2833
static: {

0 commit comments

Comments
 (0)