From 54c84c43b247241464d86f5d15c282fc714d87b6 Mon Sep 17 00:00:00 2001 From: Pablo Terradillos Date: Mon, 17 Mar 2014 19:43:13 -0300 Subject: [PATCH] Added appcache manifest - Fix #39 --- app/app.manifest | 4 ++++ app/index.html | 4 ++-- gulpfile.js | 16 ++++++++++++++++ package.json | 3 ++- 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 app/app.manifest diff --git a/app/app.manifest b/app/app.manifest new file mode 100644 index 00000000..a6f40c55 --- /dev/null +++ b/app/app.manifest @@ -0,0 +1,4 @@ +CACHE MANIFEST + +NETWORK: +* diff --git a/app/index.html b/app/index.html index 4e23df0d..4ab77bd9 100644 --- a/app/index.html +++ b/app/index.html @@ -1,5 +1,5 @@ - + @@ -60,4 +60,4 @@ - \ No newline at end of file + diff --git a/gulpfile.js b/gulpfile.js index 79217178..f91b78d1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -111,17 +111,33 @@ gulp.task('disable-production', function() { ); }); +gulp.task('add-appcache-manifest', function() { + return gulp.src('./dist/**/*') + .pipe($.manifest({ + timestamp: true, + network: ['http://*', 'https://*', '*'], + filename: 'app.manifest', + exclude: 'app.manifest' + })) + .pipe(gulp.dest('./dist')); +}); + gulp.task('clean', function() { return gulp.src(['dist/*', '!dist/.git']).pipe($.clean()); }); gulp.task('bump', ['update-version-manifests', 'update-version-settings', 'update-version-comments']); + gulp.task('build', ['templates', 'usemin', 'copy'], function () { gulp.start('disable-production'); }); gulp.task('package', ['cleanup-dist']); +gulp.task('publish', ['build'], function() { + gulp.start('add-appcache-manifest'); +}); + gulp.task('default', ['clean'], function() { gulp.start('build'); }); diff --git a/package.json b/package.json index 3888fcd4..55a74632 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "gulp-concat": "^2.1.7", "gulp-grep-stream": "0.0.2", "event-stream": "^3.1.0", - "gulp-zip": "^0.1.2" + "gulp-zip": "^0.1.2", + "gulp-manifest": "0.0.3" } }