1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | module.exports = `/**
|
20 | * Welcome to your Workbox-powered service worker!
|
21 | *
|
22 | * You'll need to register this file in your web app and you should
|
23 | * disable HTTP caching for this file too.
|
24 | * See https://goo.gl/nhQhGp
|
25 | *
|
26 | * The rest of the code is auto-generated. Please don't update this file
|
27 | * directly; instead, make changes to your Workbox build configuration
|
28 | * and re-run your build process.
|
29 | * See https://goo.gl/2aRDsh
|
30 | */
|
31 |
|
32 | <% if (workboxSWImport) { %>
|
33 | importScripts(<%= JSON.stringify(workboxSWImport) %>);
|
34 | <% if (modulePathPrefix) { %>workbox.setConfig({modulePathPrefix: <%= JSON.stringify(modulePathPrefix) %>});<% } %>
|
35 | <% } %>
|
36 | <% if (importScripts) { %>
|
37 | importScripts(
|
38 | <%= importScripts.map(JSON.stringify).join(',\\n ') %>
|
39 | );
|
40 | <% } %>
|
41 |
|
42 | <% if (cacheId) { %>workbox.core.setCacheNameDetails({prefix: <%= JSON.stringify(cacheId) %>});<% } %>
|
43 |
|
44 | <% if (skipWaiting) { %>workbox.skipWaiting();<% } %>
|
45 | <% if (clientsClaim) { %>workbox.clientsClaim();<% } %>
|
46 |
|
47 | <% if (Array.isArray(manifestEntries)) {%>
|
48 | /**
|
49 | * The workboxSW.precacheAndRoute() method efficiently caches and responds to
|
50 | * requests for URLs in the manifest.
|
51 | * See https://goo.gl/S9QRab
|
52 | */
|
53 | self.__precacheManifest = <%= JSON.stringify(manifestEntries, null, 2) %>.concat(self.__precacheManifest || []);
|
54 | workbox.precaching.suppressWarnings();
|
55 | workbox.precaching.precacheAndRoute(self.__precacheManifest, <%= precacheOptionsString %>);
|
56 | <% } else { %>
|
57 | if (Array.isArray(self.__precacheManifest)) {
|
58 | workbox.precaching.suppressWarnings();
|
59 | workbox.precaching.precacheAndRoute(self.__precacheManifest, <%= precacheOptionsString %>);
|
60 | }
|
61 | <% } %>
|
62 | <% if (navigateFallback) { %>workbox.routing.registerNavigationRoute(<%= JSON.stringify(navigateFallback) %><% if (navigateFallbackWhitelist || navigateFallbackBlacklist) { %>, {
|
63 | <% if (navigateFallbackWhitelist) { %>whitelist: [<%= navigateFallbackWhitelist %>],<% } %>
|
64 | <% if (navigateFallbackBlacklist) { %>blacklist: [<%= navigateFallbackBlacklist %>],<% } %>
|
65 | }<% } %>);<% } %>
|
66 |
|
67 | <% if (runtimeCaching) { runtimeCaching.forEach(runtimeCachingString => {%><%= runtimeCachingString %><% });} %>
|
68 |
|
69 | <% if (offlineAnalyticsConfigString) { %>workbox.googleAnalytics.initialize(<%= offlineAnalyticsConfigString %>);<% } %>`; |
\ | No newline at end of file |