-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pooya Parsa
committed
Nov 16, 2017
1 parent
e1363db
commit 7c8644c
Showing
5 changed files
with
72 additions
and
56 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
importScripts('<%= options.importPath %>') | ||
importScripts(<%= options.importScripts.map(i => `'${i}'`).join(', ') %>) | ||
|
||
const workboxSW = new self.WorkboxSW({ | ||
cacheId: '<%= options.wb.cacheId %>', | ||
clientsClaim: <%= options.wb.clientsClaim %>, | ||
directoryIndex: '<%= options.wb.directoryIndex %>' | ||
}) | ||
const workboxSW = new self.WorkboxSW(<%= JSON.stringify(options.wbOptions, null, 2) %>) | ||
|
||
workboxSW.precache([]) | ||
|
||
<% options.wb.runtimeCaching.forEach(r => { %> | ||
<% options.runtimeCaching.forEach(r => { %> | ||
workboxSW.router.registerRoute('<%= r.urlPattern %>', workboxSW.strategies.<%= r.handler %>({}), 'GET') | ||
<% }) %> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
console.log('Custom service worker!') | ||
|
||
self.addEventListener('install', function (e) { | ||
console.log('Install event:', e) | ||
}) | ||
|
||
self.addEventListener('activate', function (e) { | ||
console.log('Activate event:', e) | ||
}) |