-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add webengage import in service-worker.ejs
- Loading branch information
1 parent
9648fb0
commit 0a89776
Showing
2 changed files
with
5 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,24 +1,5 @@ | ||
<%- serviceWorkerHelper %>; | ||
|
||
const shellUrl = "/shell.html?revision=<%= assetHash("app.js") %>-<%= configVersion %>"; | ||
|
||
const REQUIRED_ASSETS = [ | ||
<%_ getFilesForChunks("app", "list", "story").map(x => { _%> | ||
"<%= x %>", | ||
<%_ }) _%> | ||
// Put fonts here | ||
shellUrl | ||
]; | ||
|
||
initializeQServiceWorker({ | ||
routes: <%- JSON.stringify(routes) %>, | ||
assets: REQUIRED_ASSETS, | ||
shell: shellUrl, | ||
hostname: <%- JSON.stringify(hostname) %> | ||
}); | ||
|
||
workbox.routing.registerRoute(new RegExp('/route-data.json*'), new workbox.strategies.NetworkFirst()); | ||
|
||
if("<%= config["public-integrations"]["one-signal"] && config["public-integrations"]["one-signal"]["app-id"] %>") { | ||
importScripts('https://cdn.onesignal.com/sdks/OneSignalSDKWorker.js'); | ||
} | ||
<%- serviceWorkerHelper %>; const shellUrl = "/shell.html?revision=<%= assetHash("app.js") %>-<%= configVersion %>"; | ||
const REQUIRED_ASSETS = [ <%_ getFilesForChunks("app", "list", "story").map(x => { _%> "<%= x %>", <%_ }) _%> // Put | ||
fonts here shellUrl ]; initializeQServiceWorker({ routes: <%- JSON.stringify(routes) %>, assets: REQUIRED_ASSETS, shell: | ||
shellUrl, hostname: <%- JSON.stringify(hostname) %> }); workbox.routing.registerRoute(new RegExp('/route-data.json*'), | ||
new workbox.strategies.NetworkFirst()); importScripts("https://ssl.widgets.webengage.com/js/service-worker.js"); |