Move watchOptions into middlewareOptions

This creates middlewareOptions and a check on USE_DOCKER_WATCHOPTIONS as a pathway to have docker containers use polling for file system updates.
parent 1624c92e
......@@ -21,15 +21,18 @@ routes.forEach(route => {
app.get(route.pattern, handler(route));
});
app.use(webpackDevMiddleware(compiler,
{
var middlewareOptions = {};
if (process.env.USE_DOCKER_WATCHOPTIONS) {
middlewareOptions = {
watchOptions: {
aggregateTimeout: 500,
poll: 2500,
ignored: ['node_modules','build']
}
}
));
};
}
app.use(webpackDevMiddleware(compiler, middlewareOptions));
var proxyHost = process.env.FALLBACK || '';
if (proxyHost !== '') {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment