Skip to content

Commit d79f1cc

Browse files
committed
Fix hotreloading inside a container
1 parent 6171699 commit d79f1cc

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

.env.backend

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
DATABASE_URL=postgres://db:5432
22
PORT=8000
3-
HALO_API_KEY=12345

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"remove-demo": "babel-node tools/removeDemo.js",
1212
"start-message": "babel-node tools/startMessage.js",
1313
"prestart": "npm-run-all --parallel start-message remove-dist",
14-
"start": "npm-run-all --parallel test:watch open:src lint:watch",
14+
"start": "npm-run-all --parallel test:watch open:src",
1515
"open:src": "babel-node tools/srcServer.js",
1616
"open:dist": "babel-node tools/distServer.js",
1717
"lint": "esw webpack.config.* src tools --color",

frontend/tools/srcServer.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,21 @@ browserSync({
4242
chunkModules: false
4343
},
4444

45+
watchOptions: {
46+
aggregateTimeout: 300,
47+
poll: true
48+
},
4549
// for other settings see
4650
// http://webpack.github.io/docs/webpack-dev-middleware.html
4751
}),
4852

4953
// bundler should be the same as above
50-
webpackHotMiddleware(bundler)
54+
webpackHotMiddleware(bundler, {
55+
watchOptions: {
56+
aggregateTimeout: 300,
57+
poll: true
58+
},
59+
})
5160
]
5261
},
5362

frontend/webpack.config.dev.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,9 @@ export default {
4545
{test: /(\.css|\.scss)$/, loaders: ['style', 'css?sourceMap', 'postcss', 'sass?sourceMap']}
4646
]
4747
},
48-
postcss: ()=> [autoprefixer]
48+
postcss: ()=> [autoprefixer],
49+
watchOptions: {
50+
poll: true,
51+
aggregateTimeout: 1000
52+
}
4953
};

0 commit comments

Comments
 (0)