|
|
|
@ -7,6 +7,7 @@ var st = require('st')
@@ -7,6 +7,7 @@ var st = require('st')
|
|
|
|
|
var del = require('del') |
|
|
|
|
var swPrecache = require('sw-precache') |
|
|
|
|
var Server = require('karma').Server |
|
|
|
|
var manifest = require('gulp-manifest3') |
|
|
|
|
|
|
|
|
|
// The generated file is being created at src
|
|
|
|
|
// so it can be fetched by usemin.
|
|
|
|
@ -236,13 +237,13 @@ function writeServiceWorkerFile (rootDir, handleFetch, callback) {
@@ -236,13 +237,13 @@ function writeServiceWorkerFile (rootDir, handleFetch, callback) {
|
|
|
|
|
swPrecache.write(path.join(rootDir, 'service_worker.js'), config, callback) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
gulp.task('generate-service-worker', gulp.series('build', function (callback) { |
|
|
|
|
/*gulp.task('generate-service-worker', gulp.series('build', function (callback) { |
|
|
|
|
writeServiceWorkerFile('dist', true, callback) |
|
|
|
|
})) |
|
|
|
|
}))*/ |
|
|
|
|
|
|
|
|
|
gulp.task('add-appcache-manifest', gulp.series('build', function () { |
|
|
|
|
return gulp.src(fileGlobs) |
|
|
|
|
.pipe($.manifest({ |
|
|
|
|
.pipe(manifest({ |
|
|
|
|
timestamp: false, |
|
|
|
|
hash: true, |
|
|
|
|
network: ['http://*', 'https://*', '*'], |
|
|
|
@ -348,7 +349,9 @@ gulp.task('tdd', gulp.series('templates', 'karma-tdd'))
@@ -348,7 +349,9 @@ gulp.task('tdd', gulp.series('templates', 'karma-tdd'))
|
|
|
|
|
|
|
|
|
|
gulp.task('package', gulp.series('cleanup-dist')) |
|
|
|
|
|
|
|
|
|
gulp.task('publish', gulp.series('add-appcache-manifest', 'generate-service-worker')) |
|
|
|
|
gulp.task('publish', gulp.series('add-appcache-manifest', function (callback) { |
|
|
|
|
writeServiceWorkerFile('dist', true, callback) |
|
|
|
|
})) |
|
|
|
|
|
|
|
|
|
gulp.task('deploy', function () { |
|
|
|
|
return gulp.src('./dist/**/*') |
|
|
|
|