@serwist/vite 9.0.0-preview.15 → 9.0.0-preview.16

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.js CHANGED
@@ -7,7 +7,7 @@ import { validationErrorMap, SerwistConfigError } from '@serwist/build/schema';
7
7
  import { normalizePath } from 'vite';
8
8
  import process from 'node:process';
9
9
 
10
- var version = "9.0.0-preview.15";
10
+ var version = "9.0.0-preview.16";
11
11
 
12
12
  const logSerwistResult = (buildResult, viteOptions)=>{
13
13
  const { logLevel = "info" } = viteOptions;
@@ -1,11 +1,9 @@
1
- import { CacheFirst, NetworkFirst } from "@serwist/strategies";
2
- export declare const defaultCache: ({
3
- matcher: RegExp;
4
- handler: CacheFirst;
5
- method?: undefined;
6
- } | {
7
- matcher: RegExp;
8
- method: "GET";
9
- handler: NetworkFirst;
10
- })[];
1
+ import type { RuntimeCaching } from "@serwist/sw";
2
+ /**
3
+ * The default, recommended list of caching strategies for applications
4
+ * built with Vite.
5
+ *
6
+ * @see https://serwist.pages.dev/docs/vite/worker-exports#default-cache
7
+ */
8
+ export declare const defaultCache: RuntimeCaching[];
11
9
  //# sourceMappingURL=index.worker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAwB,MAAM,qBAAqB,CAAC;AAGrF,eAAO,MAAM,YAAY;;;;;;;;IA4GG,CAAC"}
1
+ {"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,EA8GpC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { ExpirationPlugin } from '@serwist/expiration';
2
2
  import { CacheFirst, StaleWhileRevalidate, NetworkFirst } from '@serwist/strategies';
3
3
 
4
- const defaultCache = [
4
+ const defaultCache = import.meta.env.DEV ? [] : [
5
5
  {
6
6
  matcher: /^https:\/\/fonts\.(?:googleapis|gstatic)\.com\/.*/i,
7
7
  handler: new CacheFirst({
@@ -1,4 +1,4 @@
1
- import type { InjectPartial as BaseInjectPartial, InjectResolved as BaseInjectResolved, BasePartial, BaseResolved, GlobPartial, GlobResolved, ManifestEntry, RequiredGlobDirectoryPartial, RequiredGlobDirectoryResolved, RequiredSwDestPartial, RequiredSwDestResolved } from "@serwist/build";
1
+ import type { BasePartial, BaseResolved, GlobPartial, GlobResolved, InjectPartial as BaseInjectPartial, InjectResolved as BaseInjectResolved, ManifestEntry, RequiredGlobDirectoryPartial, RequiredGlobDirectoryResolved, RequiredSwDestPartial, RequiredSwDestResolved } from "@serwist/build";
2
2
  import type { Require } from "@serwist/utils";
3
3
  import type { RollupOptions } from "rollup";
4
4
  import type { BuildOptions, Plugin, ResolvedConfig } from "vite";
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,cAAc,IAAI,kBAAkB,EACpC,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,4BAA4B,EAC5B,6BAA6B,EAC7B,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAEjE,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC;IACpC;;;;OAIG;IACH,IAAI,CAAC,EAA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CAAC;CAC7B;AAED,MAAM,MAAM,yBAAyB,GAAG,CAAC,eAAe,EAAE,CAAC,MAAM,GAAG,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,aAAa,CAAC,EAAE,GAAG,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/vite",
3
- "version": "9.0.0-preview.15",
3
+ "version": "9.0.0-preview.16",
4
4
  "type": "module",
5
5
  "description": "A module that integrates Serwist into your Vite application.",
6
6
  "files": [
@@ -72,24 +72,24 @@
72
72
  "glob": "10.3.10",
73
73
  "kolorist": "1.8.0",
74
74
  "zod": "3.22.4",
75
- "@serwist/build": "9.0.0-preview.15",
76
- "@serwist/expiration": "9.0.0-preview.15",
77
- "@serwist/strategies": "9.0.0-preview.15",
78
- "@serwist/window": "9.0.0-preview.15"
75
+ "@serwist/build": "9.0.0-preview.16",
76
+ "@serwist/expiration": "9.0.0-preview.16",
77
+ "@serwist/strategies": "9.0.0-preview.16",
78
+ "@serwist/window": "9.0.0-preview.16"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@types/node": "20.11.30",
82
82
  "rollup": "4.13.0",
83
83
  "typescript": "5.5.0-dev.20240323",
84
84
  "vite": "5.2.4",
85
- "@serwist/constants": "9.0.0-preview.15",
86
- "@serwist/sw": "9.0.0-preview.15",
87
- "@serwist/utils": "9.0.0-preview.15"
85
+ "@serwist/constants": "9.0.0-preview.16",
86
+ "@serwist/sw": "9.0.0-preview.16",
87
+ "@serwist/utils": "9.0.0-preview.16"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "typescript": ">=5.0.0",
91
91
  "vite": "^5.0.0",
92
- "@serwist/sw": "9.0.0-preview.15"
92
+ "@serwist/sw": "9.0.0-preview.16"
93
93
  },
94
94
  "peerDependenciesMeta": {
95
95
  "@serwist/sw": {
@@ -2,112 +2,120 @@ import { ExpirationPlugin } from "@serwist/expiration";
2
2
  import { CacheFirst, NetworkFirst, StaleWhileRevalidate } from "@serwist/strategies";
3
3
  import type { RuntimeCaching } from "@serwist/sw";
4
4
 
5
- export const defaultCache = [
6
- {
7
- matcher: /^https:\/\/fonts\.(?:googleapis|gstatic)\.com\/.*/i,
8
- handler: new CacheFirst({
9
- cacheName: "google-fonts",
10
- plugins: [
11
- new ExpirationPlugin({
12
- maxEntries: 4,
13
- maxAgeSeconds: 365 * 24 * 60 * 60, // 365 days
14
- maxAgeFrom: "last-used",
5
+ /**
6
+ * The default, recommended list of caching strategies for applications
7
+ * built with Vite.
8
+ *
9
+ * @see https://serwist.pages.dev/docs/vite/worker-exports#default-cache
10
+ */
11
+ export const defaultCache: RuntimeCaching[] = import.meta.env.DEV
12
+ ? []
13
+ : [
14
+ {
15
+ matcher: /^https:\/\/fonts\.(?:googleapis|gstatic)\.com\/.*/i,
16
+ handler: new CacheFirst({
17
+ cacheName: "google-fonts",
18
+ plugins: [
19
+ new ExpirationPlugin({
20
+ maxEntries: 4,
21
+ maxAgeSeconds: 365 * 24 * 60 * 60, // 365 days
22
+ maxAgeFrom: "last-used",
23
+ }),
24
+ ],
15
25
  }),
16
- ],
17
- }),
18
- },
19
- {
20
- matcher: /\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,
21
- handler: new StaleWhileRevalidate({
22
- cacheName: "static-font-assets",
23
- plugins: [
24
- new ExpirationPlugin({
25
- maxEntries: 4,
26
- maxAgeSeconds: 7 * 24 * 60 * 60, // 7 days
27
- maxAgeFrom: "last-used",
26
+ },
27
+ {
28
+ matcher: /\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,
29
+ handler: new StaleWhileRevalidate({
30
+ cacheName: "static-font-assets",
31
+ plugins: [
32
+ new ExpirationPlugin({
33
+ maxEntries: 4,
34
+ maxAgeSeconds: 7 * 24 * 60 * 60, // 7 days
35
+ maxAgeFrom: "last-used",
36
+ }),
37
+ ],
28
38
  }),
29
- ],
30
- }),
31
- },
32
- {
33
- matcher: /\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,
34
- handler: new StaleWhileRevalidate({
35
- cacheName: "static-image-assets",
36
- plugins: [
37
- new ExpirationPlugin({
38
- maxEntries: 64,
39
- maxAgeSeconds: 24 * 60 * 60, // 24 hours
40
- maxAgeFrom: "last-used",
39
+ },
40
+ {
41
+ matcher: /\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,
42
+ handler: new StaleWhileRevalidate({
43
+ cacheName: "static-image-assets",
44
+ plugins: [
45
+ new ExpirationPlugin({
46
+ maxEntries: 64,
47
+ maxAgeSeconds: 24 * 60 * 60, // 24 hours
48
+ maxAgeFrom: "last-used",
49
+ }),
50
+ ],
41
51
  }),
42
- ],
43
- }),
44
- },
45
- {
46
- matcher: /\.(?:js)$/i,
47
- handler: new StaleWhileRevalidate({
48
- cacheName: "static-js-assets",
49
- plugins: [
50
- new ExpirationPlugin({
51
- maxEntries: 32,
52
- maxAgeSeconds: 24 * 60 * 60, // 24 hours
53
- maxAgeFrom: "last-used",
52
+ },
53
+ {
54
+ matcher: /\.(?:js)$/i,
55
+ handler: new StaleWhileRevalidate({
56
+ cacheName: "static-js-assets",
57
+ plugins: [
58
+ new ExpirationPlugin({
59
+ maxEntries: 32,
60
+ maxAgeSeconds: 24 * 60 * 60, // 24 hours
61
+ maxAgeFrom: "last-used",
62
+ }),
63
+ ],
54
64
  }),
55
- ],
56
- }),
57
- },
58
- {
59
- matcher: /\.(?:css|less)$/i,
60
- handler: new StaleWhileRevalidate({
61
- cacheName: "static-style-assets",
62
- plugins: [
63
- new ExpirationPlugin({
64
- maxEntries: 32,
65
- maxAgeSeconds: 24 * 60 * 60, // 24 hours
66
- maxAgeFrom: "last-used",
65
+ },
66
+ {
67
+ matcher: /\.(?:css|less)$/i,
68
+ handler: new StaleWhileRevalidate({
69
+ cacheName: "static-style-assets",
70
+ plugins: [
71
+ new ExpirationPlugin({
72
+ maxEntries: 32,
73
+ maxAgeSeconds: 24 * 60 * 60, // 24 hours
74
+ maxAgeFrom: "last-used",
75
+ }),
76
+ ],
67
77
  }),
68
- ],
69
- }),
70
- },
71
- {
72
- matcher: /\.(?:json|xml|csv)$/i,
73
- handler: new NetworkFirst({
74
- cacheName: "static-data-assets",
75
- plugins: [
76
- new ExpirationPlugin({
77
- maxEntries: 32,
78
- maxAgeSeconds: 24 * 60 * 60, // 24 hours
79
- maxAgeFrom: "last-used",
78
+ },
79
+ {
80
+ matcher: /\.(?:json|xml|csv)$/i,
81
+ handler: new NetworkFirst({
82
+ cacheName: "static-data-assets",
83
+ plugins: [
84
+ new ExpirationPlugin({
85
+ maxEntries: 32,
86
+ maxAgeSeconds: 24 * 60 * 60, // 24 hours
87
+ maxAgeFrom: "last-used",
88
+ }),
89
+ ],
80
90
  }),
81
- ],
82
- }),
83
- },
84
- {
85
- matcher: /\/api\/.*$/i,
86
- method: "GET",
87
- handler: new NetworkFirst({
88
- cacheName: "apis",
89
- plugins: [
90
- new ExpirationPlugin({
91
- maxEntries: 16,
92
- maxAgeSeconds: 24 * 60 * 60, // 24 hours
93
- maxAgeFrom: "last-used",
91
+ },
92
+ {
93
+ matcher: /\/api\/.*$/i,
94
+ method: "GET",
95
+ handler: new NetworkFirst({
96
+ cacheName: "apis",
97
+ plugins: [
98
+ new ExpirationPlugin({
99
+ maxEntries: 16,
100
+ maxAgeSeconds: 24 * 60 * 60, // 24 hours
101
+ maxAgeFrom: "last-used",
102
+ }),
103
+ ],
104
+ networkTimeoutSeconds: 10, // fallback to cache if API does not response within 10 seconds
94
105
  }),
95
- ],
96
- networkTimeoutSeconds: 10, // fallback to cache if API does not response within 10 seconds
97
- }),
98
- },
99
- {
100
- matcher: /.*/i,
101
- handler: new NetworkFirst({
102
- cacheName: "others",
103
- plugins: [
104
- new ExpirationPlugin({
105
- maxEntries: 32,
106
- maxAgeSeconds: 24 * 60 * 60, // 24 hours
107
- maxAgeFrom: "last-used",
106
+ },
107
+ {
108
+ matcher: /.*/i,
109
+ handler: new NetworkFirst({
110
+ cacheName: "others",
111
+ plugins: [
112
+ new ExpirationPlugin({
113
+ maxEntries: 32,
114
+ maxAgeSeconds: 24 * 60 * 60, // 24 hours
115
+ maxAgeFrom: "last-used",
116
+ }),
117
+ ],
118
+ networkTimeoutSeconds: 10,
108
119
  }),
109
- ],
110
- networkTimeoutSeconds: 10,
111
- }),
112
- },
113
- ] satisfies RuntimeCaching[];
120
+ },
121
+ ];
package/src/lib/types.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type {
2
- InjectPartial as BaseInjectPartial,
3
- InjectResolved as BaseInjectResolved,
4
2
  BasePartial,
5
3
  BaseResolved,
6
4
  GlobPartial,
7
5
  GlobResolved,
6
+ InjectPartial as BaseInjectPartial,
7
+ InjectResolved as BaseInjectResolved,
8
8
  ManifestEntry,
9
9
  RequiredGlobDirectoryPartial,
10
10
  RequiredGlobDirectoryResolved,