diff options
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | gulpfile.js | 8 | ||||
-rw-r--r-- | package.json | 3 |
3 files changed, 16 insertions, 5 deletions
@@ -171,3 +171,13 @@ else phpunit -c phpunit.xml --coverage-clover build/php-unit.clover phpunit -c phpunit.integration.xml --coverage-clover build/php-unit.clover endif + +# watch out for changes and rebuild +.PHONY: watch +watch: +ifneq (,$(wildcard $(CURDIR)/js/package.json)) + cd js && $(npm) run watch +endif +ifneq (,$(wildcard $(CURDIR)/package.json)) + $(npm) run watch +endif diff --git a/gulpfile.js b/gulpfile.js index 52794481..d855c9e5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -33,13 +33,13 @@ gulp.task('eslint', function() { .pipe(eslint()) .pipe(eslint.format()) .pipe(eslint.failAfterError()); -}) +}); -gulp.task('watch', ['js'], function() { - gulp.watch(['js/**/*.js', '!js/public/**/*.js'], ['js']); +gulp.task('watch', ['default'], function() { + gulp.watch(['js/**/*.js', '!js/public/**/*.js'], ['default']); }); -gulp.task('karma', (done) => { +gulp.task('karma', function(done){ new KarmaServer({ configFile: __dirname + '/karma.conf.js', singleRun: true diff --git a/package.json b/package.json index 3bbac320..444a37af 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "scripts": { "test": "node node_modules/gulp-cli/bin/gulp.js karma", "prebuild": "npm install && npm update && node_modules/bower/bin/bower install && node_modules/bower/bin/bower update", - "build": "node node_modules/gulp-cli/bin/gulp.js" + "build": "node node_modules/gulp-cli/bin/gulp.js", + "watch": "node node_modules/gulp-cli/bin/gulp.js watch" }, "devDependencies": { "bower": "", |