From b4d0219d4eab9ed785f14bcd756b2ea6b7af00e8 Mon Sep 17 00:00:00 2001 From: Aileen Nowak Date: Mon, 15 Apr 2019 12:55:37 +0800 Subject: [PATCH] Added livereload for .hbs files --- gulpfile.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 5daae14..8870802 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 @@ -29,6 +29,13 @@ const handleError = (done) => { }; }; +function hbs(done) { + pump([ + src(['*.hbs', 'partials/**/*.hbs', '!node_modules/**/*.hbs']), + livereload() + ], handleError(done)); +} + function css(done) { const processors = [ easyimport, @@ -71,7 +78,9 @@ function zipper(done) { ], handleError(done)); } -const watcher = () => watch('assets/css/**', css); +const cssWatcher = () => watch('assets/css/**', css); +const hbsWatcher = () => watch(['*.hbs', 'partials/**/*.hbs', '!node_modules/**/*.hbs'], hbs); +const watcher = parallel(cssWatcher, hbsWatcher); const build = series(css, js); const dev = series(build, serve, watcher); @@ -170,8 +179,7 @@ const release = () => { } return previousRelease() - .then((previousVersion)=> { - + .then((previousVersion) => { changelog({previousVersion}); return releaseUtils @@ -190,7 +198,7 @@ const release = () => { content: [`**Ships with Ghost ${shipsWithGhost} Compatible with Ghost >= ${compatibleWithGhost}**\n\n`], changelogPath: CHANGELOG_PATH }) - .then((response)=> { + .then((response) => { console.log(`\nRelease draft generated: ${response.releaseUrl}\n`); }); });