@serwist/sw 8.0.1 → 8.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export type SerwistOptions = HandlePrecachingOptions & {
10
10
  cacheId?: string | undefined;
11
11
  clientsClaim?: boolean;
12
12
  runtimeCaching?: RuntimeCaching[];
13
- offlineAnalyticsConfig?: GoogleAnalyticsInitializeOptions;
13
+ offlineAnalyticsConfig?: GoogleAnalyticsInitializeOptions | boolean;
14
14
  disableDevLogs?: boolean;
15
15
  };
16
16
  export declare const installSerwist: ({ precacheEntries, precacheOptions, cleanupOutdatedCaches, skipWaiting: shouldSkipWaiting, importScripts: scriptsToImport, navigationPreload, cacheId, clientsClaim: shouldClaimClients, runtimeCaching, offlineAnalyticsConfig, disableDevLogs: shouldDisableDevLogs, ...options }: SerwistOptions) => void;
package/dist/index.js CHANGED
@@ -97,7 +97,13 @@ const installSerwist = ({ precacheEntries, precacheOptions, cleanupOutdatedCache
97
97
  }
98
98
  });
99
99
  if (runtimeCaching !== undefined) registerRuntimeCaching(...runtimeCaching);
100
- if (offlineAnalyticsConfig !== undefined) initialize(offlineAnalyticsConfig);
100
+ if (offlineAnalyticsConfig !== undefined) {
101
+ if (typeof offlineAnalyticsConfig === "boolean") {
102
+ offlineAnalyticsConfig && initialize();
103
+ } else {
104
+ initialize(offlineAnalyticsConfig);
105
+ }
106
+ }
101
107
  if (shouldDisableDevLogs) disableDevLogs();
102
108
  };
103
109
 
@@ -99,7 +99,13 @@ const installSerwist = ({ precacheEntries, precacheOptions, cleanupOutdatedCache
99
99
  }
100
100
  });
101
101
  if (runtimeCaching !== undefined) registerRuntimeCaching(...runtimeCaching);
102
- if (offlineAnalyticsConfig !== undefined) initialize.initialize(offlineAnalyticsConfig);
102
+ if (offlineAnalyticsConfig !== undefined) {
103
+ if (typeof offlineAnalyticsConfig === "boolean") {
104
+ offlineAnalyticsConfig && initialize.initialize();
105
+ } else {
106
+ initialize.initialize(offlineAnalyticsConfig);
107
+ }
108
+ }
103
109
  if (shouldDisableDevLogs) disableDevLogs();
104
110
  };
105
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/sw",
3
- "version": "8.0.1",
3
+ "version": "8.0.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "This module makes it easy to get started with the Serwist service worker libraries.",
@@ -30,22 +30,22 @@
30
30
  "./package.json": "./package.json"
31
31
  },
32
32
  "dependencies": {
33
- "@serwist/background-sync": "8.0.1",
34
- "@serwist/broadcast-update": "8.0.1",
35
- "@serwist/cacheable-response": "8.0.1",
36
- "@serwist/core": "8.0.1",
37
- "@serwist/expiration": "8.0.1",
38
- "@serwist/google-analytics": "8.0.1",
39
- "@serwist/navigation-preload": "8.0.1",
40
- "@serwist/precaching": "8.0.1",
41
- "@serwist/range-requests": "8.0.1",
42
- "@serwist/routing": "8.0.1",
43
- "@serwist/strategies": "8.0.1"
33
+ "@serwist/background-sync": "8.0.3",
34
+ "@serwist/broadcast-update": "8.0.3",
35
+ "@serwist/cacheable-response": "8.0.3",
36
+ "@serwist/core": "8.0.3",
37
+ "@serwist/expiration": "8.0.3",
38
+ "@serwist/google-analytics": "8.0.3",
39
+ "@serwist/navigation-preload": "8.0.3",
40
+ "@serwist/precaching": "8.0.3",
41
+ "@serwist/range-requests": "8.0.3",
42
+ "@serwist/routing": "8.0.3",
43
+ "@serwist/strategies": "8.0.3"
44
44
  },
45
45
  "devDependencies": {
46
46
  "rollup": "3.28.1",
47
- "@serwist/build": "8.0.1",
48
- "@serwist/constants": "8.0.1"
47
+ "@serwist/build": "8.0.3",
48
+ "@serwist/constants": "8.0.3"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "rimraf dist && cross-env NODE_ENV=production rollup --config rollup.config.js",