From 12536ca9ddb471d604ac2a4c83e08288343a0034 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Wed, 14 May 2014 21:32:49 +0400 Subject: [PATCH] Improved gulp task for cache manifest --- gulpfile.js | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 05a8bb55..df02f00b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -130,14 +130,37 @@ gulp.task('disable-production', function() { }); gulp.task('add-appcache-manifest', function() { - return gulp.src(['./dist/**/*', '!dist/manifest.*', '!dist/index.html', '!dist/fonts/*', '!dist/img/icons/icon*.png', '!dist/js/background.js']) - .pipe($.manifest({ - timestamp: true, - network: ['http://*', 'https://*', '*'], - filename: 'webogram.appcache', - exclude: 'webogram.appcache' - })) - .pipe(gulp.dest('./dist')); + + var sources = [ + './dist/**/*', + '!dist/manifest.*', + '!dist/index.html', + '!dist/fonts/*', + '!dist/img/icons/icon*.png', + '!dist/js/background.js' + ]; + + return es.concat( + gulp.src(sources) + .pipe($.manifest({ + timestamp: true, + network: ['http://*', 'https://*', '*'], + filename: 'webogram.appcache', + exclude: ['webogram.appcache', 'app.manifest'] + }) + ) + .pipe(gulp.dest('./dist')), + + gulp.src(sources) + .pipe($.manifest({ + timestamp: true, + network: ['http://*', 'https://*', '*'], + filename: 'app.manifest', + exclude: ['webogram.appcache', 'app.manifest'] + }) + ) + .pipe(gulp.dest('./dist')) + ); });