Last active
January 18, 2018 22:20
-
-
Save attilavago/1d2ee905e461380e047d852571c73971 to your computer and use it in GitHub Desktop.
Gulpfile for R.O.A.S. service worker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var swPrecache = require('sw-precache'); | |
gulp.task('generate-service-worker', function(callback) { | |
var rootDir = 'app'; | |
swPrecache.write(`${rootDir}/service-worker.js`, { | |
staticFileGlobs: ['app/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff,woff2,mp3,json}'], | |
maximumFileSizeToCacheInBytes: ['52428800'] | |
}, callback); | |
}); | |
gulp.task( 'default', [ 'generate-service-worker' ] ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment