Skip to content

Commit

Permalink
add webengage import in service-worker.ejs
Browse files Browse the repository at this point in the history
  • Loading branch information
phaneendraandukuri committed Feb 16, 2023
1 parent 9648fb0 commit 0a89776
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 26 deletions.
2 changes: 0 additions & 2 deletions public/service-worker.js

This file was deleted.

29 changes: 5 additions & 24 deletions views/js/service-worker.ejs
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");

0 comments on commit 0a89776

Please sign in to comment.