diff --git a/Makefile b/Makefile index aa7650a7c..90ff54864 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,8 @@ rl-compile: @docker-compose run --no-deps --rm node gulp build rl-compile-with-source: @docker-compose run --no-deps --rm node gulp build --source +rl-watch-css: + @docker-compose run --no-deps --rm node npm run watch-css rl-watch-js: @docker-compose run --no-deps --rm node npm run watch-js diff --git a/gulpfile.js b/gulpfile.js index 403080708..e78aabdef 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -6,6 +6,7 @@ const { assets } = require('./tasks/assets'); const { js, jsLint } = require('./tasks/js'); const { css, cssLint } = require('./tasks/css'); const { vendors } = require('./tasks/vendors'); +const { watchCss } = require('./tasks/watch'); const { rainloop } = require('./tasks/rainloop'); const { owncloud } = require('./tasks/owncloud'); @@ -23,6 +24,8 @@ exports.lint = lint; exports.build = build; exports.default = build; +exports.watchCss = watchCss; + exports.rainloop = gulp.series(build, rainloop); exports.owncloud = gulp.series(build, owncloud); exports.all = gulp.series(exports.rainloop, exports.owncloud); diff --git a/package.json b/package.json index d61f03860..e62ad6c95 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "url": "git://github.com/RainLoop/rainloop-webmail.git" }, "scripts": { - "watch-css": "gulp watch", + "watch-css": "gulp watchCss", "watch-js": "webpack --color --watch" }, "license": "SEE LICENSE IN LICENSE", diff --git a/tasks/watch.js b/tasks/watch.js new file mode 100644 index 000000000..bba3a4431 --- /dev/null +++ b/tasks/watch.js @@ -0,0 +1,12 @@ +/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL 3 */ +const gulp = require('gulp'); + +const { config } = require('./config'); +const { cssBuild } = require('./css'); + +const watchCss = gulp.series(cssBuild, (cb) => { + gulp.watch(config.paths.less.main.watch, { interval: config.watchInterval }, cssBuild); + cb(); +}); + +exports.watchCss = watchCss;