@serwist/next 9.0.11 → 9.0.12

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAInE;;;;GAIG;AACH,QAAA,MAAM,eAAe,gBAAiB,qBAAqB,KAAG,CAAC,CAAC,UAAU,CAAC,EAAE,UAAU,KAAK,UAAU,CAqNrG,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,OAAO,EAAE,6BAA6B,EAAE,CAAC;AACzC,YAAY,EAAE,qBAAqB,IAAI,aAAa,EAAE,6BAA6B,IAAI,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAInE;;;;GAIG;AACH,QAAA,MAAM,eAAe,gBAAiB,qBAAqB,KAAG,CAAC,CAAC,UAAU,CAAC,EAAE,UAAU,KAAK,UAAU,CA8NrG,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,OAAO,EAAE,6BAA6B,EAAE,CAAC;AACzC,YAAY,EAAE,qBAAqB,IAAI,aAAa,EAAE,6BAA6B,IAAI,qBAAqB,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -99,6 +99,11 @@ const validateInjectManifestOptions = (input)=>{
99
99
 
100
100
  const dirname = "__dirname" in globalThis ? __dirname : fileURLToPath(new URL(".", import.meta.url));
101
101
  const withSerwistInit = (userOptions)=>{
102
+ if (process.env.TURBOPACK && !process.env.SERWIST_SUPPRESS_TURBOPACK_WARNING) {
103
+ console.warn(`[@serwist/next] WARNING: You are using '@serwist/next' with \`next dev --turbopack\`, but Serwist doesn't support Turbopack at the moment. It is recommended
104
+ that you set \`disable\` to \`process.env.NODE_ENV !== \"production\"\`. Follow this issue for progress on Serwist + Turbopack: https://github.com/serwist/serwist/issues/54.
105
+ You can also suppress this warning by setting SERWIST_SUPPRESS_TURBOPACK_WARNING=1.`);
106
+ }
102
107
  return (nextConfig = {})=>({
103
108
  ...nextConfig,
104
109
  webpack (config, options) {
@@ -231,7 +236,7 @@ const withSerwistInit = (userOptions)=>{
231
236
  ({ asset, compilation })=>{
232
237
  const swDestRelativeOutput = relativeToOutputPath(compilation, swDest);
233
238
  const swAsset = compilation.getAsset(swDestRelativeOutput);
234
- return asset.name === swAsset?.name || asset.name.startsWith("server/") || /^((app-|^)build-manifest\.json|react-loadable-manifest\.json)$/.test(asset.name) || dev && !asset.name.startsWith("static/runtime/");
239
+ return asset.name === swAsset?.name || asset.name.startsWith("server/") || /^[^\/]*\.json$/.test(asset.name) || dev && !asset.name.startsWith("static/runtime/");
235
240
  }
236
241
  ],
237
242
  manifestTransforms: [
@@ -1,4 +1,4 @@
1
- import { NetworkOnly, CacheFirst, ExpirationPlugin, StaleWhileRevalidate, RangeRequestsPlugin, NetworkFirst } from 'serwist';
1
+ import { NetworkOnly, CacheFirst, StaleWhileRevalidate, NetworkFirst, ExpirationPlugin, RangeRequestsPlugin } from 'serwist';
2
2
 
3
3
  const PAGES_CACHE_NAME = {
4
4
  rscPrefetch: "pages-rsc-prefetch",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/next",
3
- "version": "9.0.11",
3
+ "version": "9.0.12",
4
4
  "type": "module",
5
5
  "description": "A module that integrates Serwist into your Next.js application.",
6
6
  "files": [
@@ -62,25 +62,25 @@
62
62
  "./package.json": "./package.json"
63
63
  },
64
64
  "dependencies": {
65
- "chalk": "5.3.0",
65
+ "chalk": "5.4.1",
66
66
  "glob": "10.4.5",
67
- "zod": "3.23.8",
68
- "@serwist/build": "9.0.11",
69
- "@serwist/webpack-plugin": "9.0.11",
70
- "@serwist/window": "9.0.11",
71
- "serwist": "9.0.11"
67
+ "zod": "3.24.2",
68
+ "@serwist/build": "9.0.12",
69
+ "@serwist/webpack-plugin": "9.0.12",
70
+ "@serwist/window": "9.0.12",
71
+ "serwist": "9.0.12"
72
72
  },
73
73
  "devDependencies": {
74
- "@types/node": "22.10.1",
75
- "next": "15.0.3",
74
+ "@types/node": "22.13.5",
75
+ "next": "15.1.7",
76
76
  "react": "19.0.0",
77
77
  "react-dom": "19.0.0",
78
- "rollup": "4.28.0",
79
- "type-fest": "4.30.0",
78
+ "rollup": "4.34.8",
79
+ "type-fest": "4.35.0",
80
80
  "typescript": "5.6.3",
81
- "webpack": "5.97.1",
82
- "@serwist/configs": "9.0.11",
83
- "@serwist/utils": "9.0.11"
81
+ "webpack": "5.98.0",
82
+ "@serwist/configs": "9.0.12",
83
+ "@serwist/utils": "9.0.12"
84
84
  },
85
85
  "peerDependencies": {
86
86
  "next": ">=14.0.0",
package/src/index.ts CHANGED
@@ -19,7 +19,13 @@ const dirname = "__dirname" in globalThis ? __dirname : fileURLToPath(new URL(".
19
19
  * @returns
20
20
  */
21
21
  const withSerwistInit = (userOptions: InjectManifestOptions): ((nextConfig?: NextConfig) => NextConfig) => {
22
-
22
+ if (process.env.TURBOPACK && !process.env.SERWIST_SUPPRESS_TURBOPACK_WARNING) {
23
+ console.warn(
24
+ `[@serwist/next] WARNING: You are using '@serwist/next' with \`next dev --turbopack\`, but Serwist doesn't support Turbopack at the moment. It is recommended
25
+ that you set \`disable\` to \`process.env.NODE_ENV !== \"production\"\`. Follow this issue for progress on Serwist + Turbopack: https://github.com/serwist/serwist/issues/54.
26
+ You can also suppress this warning by setting SERWIST_SUPPRESS_TURBOPACK_WARNING=1.`,
27
+ );
28
+ }
23
29
  return (nextConfig = {}) => ({
24
30
  ...nextConfig,
25
31
  webpack(config: Configuration, options) {
@@ -196,7 +202,10 @@ const withSerwistInit = (userOptions: InjectManifestOptions): ((nextConfig?: Nex
196
202
  // We don't need the service worker to be cached.
197
203
  asset.name === swAsset?.name ||
198
204
  asset.name.startsWith("server/") ||
199
- /^((app-|^)build-manifest\.json|react-loadable-manifest\.json)$/.test(asset.name) ||
205
+ // This excludes all JSON files in the compilation directory by filtering
206
+ // out paths that have slashes or don't end with `.json`. Only said files
207
+ // match this criterion.
208
+ /^[^\/]*\.json$/.test(asset.name) ||
200
209
  (dev && !asset.name.startsWith("static/runtime/"))
201
210
  );
202
211
  },