mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-07-06 00:41:34 -04:00
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.
This commit is contained in:
parent
1624c92ef4
commit
a76e36054c
1 changed files with 7 additions and 4 deletions
|
@ -21,15 +21,18 @@ routes.forEach(route => {
|
||||||
app.get(route.pattern, handler(route));
|
app.get(route.pattern, handler(route));
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(webpackDevMiddleware(compiler,
|
var middlewareOptions = {};
|
||||||
{
|
if (process.env.USE_DOCKER_WATCHOPTIONS) {
|
||||||
|
middlewareOptions = {
|
||||||
watchOptions: {
|
watchOptions: {
|
||||||
aggregateTimeout: 500,
|
aggregateTimeout: 500,
|
||||||
poll: 2500,
|
poll: 2500,
|
||||||
ignored: ['node_modules','build']
|
ignored: ['node_modules','build']
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
));
|
}
|
||||||
|
|
||||||
|
app.use(webpackDevMiddleware(compiler, middlewareOptions));
|
||||||
|
|
||||||
var proxyHost = process.env.FALLBACK || '';
|
var proxyHost = process.env.FALLBACK || '';
|
||||||
if (proxyHost !== '') {
|
if (proxyHost !== '') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue