diff --git a/README.md b/README.md index 59e4c2d38..05215ffab 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Development Installation 3. Copy `deployment/ansible/group_vars/development_template` to `deployment/ansible/group_vars/development` 4. Run `vagrant up` 5. See the app at http://localhost:8024! See OpenTripPlanner at http://localhost:9090. -6. Running `npm run gulp` from `/opt/app/src` will rebuild the front-end app on file change (the browser must be reloaded manually to pick up the change). Alternatively, `npm run gulp-development` can be run manually whenever changes are made to the static files. +6. Running `./scripts/serve-js-dev.sh` on the host will rebuild the front-end app on file change (the browser must be reloaded manually to pick up the change). Alternatively, `cd /opt/app/src && npm run gulp-development` can be run manually in the VM to pick up changes to the static files. Note that if there is an existing build Graph.obj in `otp_data`, vagrant provisioning in development mode will not attempt to rebuild the graph, but will use the one already present. diff --git a/scripts/serve-js-dev.sh b/scripts/serve-js-dev.sh new file mode 100755 index 000000000..7b088f650 --- /dev/null +++ b/scripts/serve-js-dev.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -x + +# Run JS and styles watcher to rebuild frontend on file change +# (Page reload still required) +vagrant ssh app -c "cd /opt/app/src && npm run gulp" diff --git a/src/gulpfile.js b/src/gulpfile.js index fe272ce0b..98ad6ec05 100644 --- a/src/gulpfile.js +++ b/src/gulpfile.js @@ -328,7 +328,7 @@ gulp.task('watch', function () { 'app/scripts/**/*.js', 'app/styles/**/*.css', 'app/styles/**/*.scss' - ], { usePolling: true }, gulp.parallel('development')); + ], { usePolling: true }, gulp.parallel('jshint', 'development')); }); -gulp.task('default', gulp.series('development', 'watch')); +gulp.task('default', gulp.series('jshint', 'development', 'watch'));