@tramvai/pwa-recipes 7.36.0 → 7.37.2
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/lib/routing.es.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { pwaScopes } from '@tramvai/cli/lib/external/pwa';
|
|
2
|
+
|
|
1
3
|
const isApplicationAsset = (request) => request.url.startsWith(process.env.ASSETS_PREFIX);
|
|
2
4
|
const isApplicationScope = (request) => {
|
|
3
|
-
|
|
5
|
+
const { pathname } = new URL(request.url);
|
|
6
|
+
return pwaScopes.some((pwaScope) => pathname.startsWith(pwaScope));
|
|
4
7
|
};
|
|
5
8
|
|
|
6
9
|
export { isApplicationAsset, isApplicationScope };
|
package/lib/routing.js
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var pwa = require('@tramvai/cli/lib/external/pwa');
|
|
6
|
+
|
|
5
7
|
const isApplicationAsset = (request) => request.url.startsWith(process.env.ASSETS_PREFIX);
|
|
6
8
|
const isApplicationScope = (request) => {
|
|
7
|
-
|
|
9
|
+
const { pathname } = new URL(request.url);
|
|
10
|
+
return pwa.pwaScopes.some((pwaScope) => pathname.startsWith(pwaScope));
|
|
8
11
|
};
|
|
9
12
|
|
|
10
13
|
exports.isApplicationAsset = isApplicationAsset;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { pwaScopes } from '@tramvai/cli/lib/external/pwa';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* reference - https://github.com/GoogleChrome/workbox/blob/v7/packages/workbox-recipes/src/warmStrategyCache.ts
|
|
3
5
|
*/
|
|
@@ -43,7 +45,7 @@ function matchResourceType(type, path) {
|
|
|
43
45
|
path.endsWith('.ttf') ||
|
|
44
46
|
path.endsWith('.otf'));
|
|
45
47
|
case 'html':
|
|
46
|
-
return ((path.startsWith(
|
|
48
|
+
return ((pwaScopes.some((pwaScope) => path.startsWith(pwaScope)) &&
|
|
47
49
|
!matchResourceType('manifest', path)) ||
|
|
48
50
|
path.endsWith('.html'));
|
|
49
51
|
default:
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var pwa = require('@tramvai/cli/lib/external/pwa');
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* reference - https://github.com/GoogleChrome/workbox/blob/v7/packages/workbox-recipes/src/warmStrategyCache.ts
|
|
7
9
|
*/
|
|
@@ -47,7 +49,7 @@ function matchResourceType(type, path) {
|
|
|
47
49
|
path.endsWith('.ttf') ||
|
|
48
50
|
path.endsWith('.otf'));
|
|
49
51
|
case 'html':
|
|
50
|
-
return ((path.startsWith(
|
|
52
|
+
return ((pwa.pwaScopes.some((pwaScope) => path.startsWith(pwaScope)) &&
|
|
51
53
|
!matchResourceType('manifest', path)) ||
|
|
52
54
|
path.endsWith('.html'));
|
|
53
55
|
default:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/pwa-recipes",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.37.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.es.js",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"registry": "https://registry.npmjs.org/"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@tramvai/cli": "7.37.2",
|
|
25
26
|
"workbox-cacheable-response": "^6.6.1",
|
|
26
27
|
"workbox-expiration": "^6.6.1",
|
|
27
28
|
"workbox-precaching": "^6.6.1",
|