mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
watchOptions required for use in docker environment
This will work in both docker and outside of docker, and tunes the load on a docker container running webpack to not overly burden a local host’s cpu watching for changes. By default, webpack-dev-middleware is supposed to be watching, but in practice this seems to not be the case in docker containers, as fsevents are not passed through the NFS mount into a container and it requires explicit polling to enable watching for changes.
This commit is contained in:
parent
41242c3a46
commit
2dd9d5a27e
1 changed files with 9 additions and 1 deletions
|
@ -21,7 +21,15 @@ routes.forEach(route => {
|
|||
app.get(route.pattern, handler(route));
|
||||
});
|
||||
|
||||
app.use(webpackDevMiddleware(compiler));
|
||||
app.use(webpackDevMiddleware(compiler,
|
||||
{
|
||||
watchOptions: {
|
||||
aggregateTimeout: 500,
|
||||
poll: 2500,
|
||||
ignored: ['node_modules','build']
|
||||
}
|
||||
}
|
||||
));
|
||||
|
||||
var proxyHost = process.env.FALLBACK || '';
|
||||
if (proxyHost !== '') {
|
||||
|
|
Loading…
Reference in a new issue