X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=gulpfile.js;h=373515f87000179abe614d96aeb88acf312b7baf;hb=842d703b029d8eddf7e88dff82e25026c42e9c6b;hp=ea46129d78b65ddb4dc36acf86b3ad0f7d60870c;hpb=189b10e5d29d1307671057f17c670c40da782a8d;p=editorial.git diff --git a/gulpfile.js b/gulpfile.js index ea46129..373515f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,4 +1,4 @@ -const { series, watch, src, dest } = require('gulp'); +const {series, watch, src, dest, parallel} = require('gulp'); const pump = require('pump'); // gulp plugins and utils @@ -23,11 +23,18 @@ const handleError = (done) => { sass.compiler = require('node-sass'); +function hbs(done) { + pump([ + src(['*.hbs', 'partials/**/*.hbs', '!node_modules/**/*.hbs']), + livereload() + ], handleError(done)); +} + function css(done) { pump([ - src('./assets/main/sass/*.scss', { sourcemaps: true }), - sass({ outputStyle: 'compressed' }).on('error', sass.logError), - dest('assets/main/css', { sourcemaps: './' }), + src('./assets/main/sass/*.scss', {sourcemaps: true}), + sass({outputStyle: 'compressed'}).on('error', sass.logError), + dest('assets/main/css', {sourcemaps: './'}), livereload() ], handleError(done)); } @@ -48,7 +55,9 @@ function zipper(done) { ], handleError(done)); } -const watcher = () => watch('./assets/main/sass/**/**', css); +const cssWatcher = () => watch('./assets/main/sass/**/**', css); +const hbsWatcher = () => watch(['*.hbs', 'partials/**/*.hbs', '!node_modules/**/*.hbs'], hbs); +const watcher = parallel(cssWatcher, hbsWatcher); const build = series(css); const dev = series(build, serve, watcher);