diff options
author | Michael Krotscheck <krotscheck@gmail.com> | 2015-07-31 13:52:32 +1000 |
---|---|---|
committer | Michael Krotscheck <krotscheck@gmail.com> | 2015-07-31 13:52:32 +1000 |
commit | 07af1fb4779c936c588e33a36707a0015c45504e (patch) | |
tree | c4ba4621ab52e4af3545a15f00ce54af78ba7181 | |
parent | e6e4cb6d5c9c83a71a23011557e50601488a1b2e (diff) |
Images are now synchronized into dist folder.
Note that any new files won't get picked up without a
server restart.
-rw-r--r-- | gulpfile.js | 21 |
1 files 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 @@ | |||
27 | var paths = { | 27 | var paths = { |
28 | 'html': dir.src + '/**/*.html', | 28 | 'html': dir.src + '/**/*.html', |
29 | 'hbs': dir.src + '/index.hbs', | 29 | 'hbs': dir.src + '/index.hbs', |
30 | 'index': dir.src + '/index.hbs' | 30 | 'index': dir.src + '/index.hbs', |
31 | 'images': [ | ||
32 | dir.src + '/**/*.png', | ||
33 | dir.src + '/**/*.gif', | ||
34 | dir.src + '/**/*.jpg', | ||
35 | dir.src + '/**/*.jpeg', | ||
36 | dir.src + '/**/*.svg' | ||
37 | ] | ||
31 | }; | 38 | }; |
32 | 39 | ||
33 | // Contents of all our bower dependencies' main:[] fields. | 40 | // Contents of all our bower dependencies' main:[] fields. |
@@ -128,6 +135,14 @@ | |||
128 | }); | 135 | }); |
129 | 136 | ||
130 | /** | 137 | /** |
138 | * Package all images. | ||
139 | */ | ||
140 | gulp.task('package:images', function () { | ||
141 | return gulp.src(paths.images, {'base': dir.src}) | ||
142 | .pipe(gulp.dest(dir.dist)); | ||
143 | }); | ||
144 | |||
145 | /** | ||
131 | * Package the handlebars files. | 146 | * Package the handlebars files. |
132 | */ | 147 | */ |
133 | gulp.task('package:hbs', function () { | 148 | gulp.task('package:hbs', function () { |
@@ -214,7 +229,8 @@ | |||
214 | /** | 229 | /** |
215 | * Package the entire site into the dist folder. | 230 | * Package the entire site into the dist folder. |
216 | */ | 231 | */ |
217 | gulp.task('package', ['package:html', 'package:hbs', 'package:libs']); | 232 | gulp.task('package', ['package:html', 'package:hbs', 'package:libs', |
233 | 'package:images']); | ||
218 | 234 | ||
219 | /** | 235 | /** |
220 | * Push the contents of the dist directory to gh-pages. | 236 | * Push the contents of the dist directory to gh-pages. |
@@ -237,6 +253,7 @@ | |||
237 | */ | 253 | */ |
238 | gulp.task('serve', function () { | 254 | gulp.task('serve', function () { |
239 | gulp.watch(paths.html, ['package:html']); | 255 | gulp.watch(paths.html, ['package:html']); |
256 | gulp.watch(paths.images, ['package:images']); | ||
240 | gulp.watch(paths.hbs, ['package:hbs']); | 257 | gulp.watch(paths.hbs, ['package:hbs']); |
241 | 258 | ||
242 | return gulp.src(dir.dist) | 259 | return gulp.src(dir.dist) |