Merge pull request #1975 from colbygk/docker_ergonomics

watchOptions required for use in docker environment
This commit is contained in:
Colby Gutierrez-Kraybill 2018-07-23 09:50:21 -04:00 committed by GitHub
commit 21d2f73bd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -5,3 +5,4 @@ intl/*
locales/* locales/*
**/*.min.js **/*.min.js
**/node_modules/* **/node_modules/*
scratch-gui/*

View file

@ -21,7 +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: {
aggregateTimeout: 500,
poll: 2500,
ignored: ['node_modules', 'build']
}
};
}
app.use(webpackDevMiddleware(compiler, middlewareOptions));
var proxyHost = process.env.FALLBACK || ''; var proxyHost = process.env.FALLBACK || '';
if (proxyHost !== '') { if (proxyHost !== '') {

View file

@ -15,6 +15,7 @@ services:
environment: environment:
- API_HOST=http://localhost:8491 - API_HOST=http://localhost:8491
- FALLBACK=http://localhost:8080 - FALLBACK=http://localhost:8080
- USE_DOCKER_WATCHOPTIONS=true
build: build:
context: ./ context: ./
dockerfile: Dockerfile dockerfile: Dockerfile