From 07af1fb4779c936c588e33a36707a0015c45504e Mon Sep 17 00:00:00 2001 From: Michael Krotscheck Date: Fri, 31 Jul 2015 13:52:32 +1000 Subject: Images are now synchronized into dist folder. Note that any new files won't get picked up without a server restart. --- gulpfile.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index cffd79c..3bb9d6a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -27,7 +27,14 @@ var paths = { 'html': dir.src + '/**/*.html', 'hbs': dir.src + '/index.hbs', - 'index': dir.src + '/index.hbs' + 'index': dir.src + '/index.hbs', + 'images': [ + dir.src + '/**/*.png', + dir.src + '/**/*.gif', + dir.src + '/**/*.jpg', + dir.src + '/**/*.jpeg', + dir.src + '/**/*.svg' + ] }; // Contents of all our bower dependencies' main:[] fields. @@ -127,6 +134,14 @@ resolveReveal, resolveLibs, resolveFonts); }); + /** + * Package all images. + */ + gulp.task('package:images', function () { + return gulp.src(paths.images, {'base': dir.src}) + .pipe(gulp.dest(dir.dist)); + }); + /** * Package the handlebars files. */ @@ -214,7 +229,8 @@ /** * Package the entire site into the dist folder. */ - gulp.task('package', ['package:html', 'package:hbs', 'package:libs']); + gulp.task('package', ['package:html', 'package:hbs', 'package:libs', + 'package:images']); /** * Push the contents of the dist directory to gh-pages. @@ -237,6 +253,7 @@ */ gulp.task('serve', function () { gulp.watch(paths.html, ['package:html']); + gulp.watch(paths.images, ['package:images']); gulp.watch(paths.hbs, ['package:hbs']); return gulp.src(dir.dist) -- cgit v1.2.3