@serwist/webpack-plugin 9.0.2 → 9.0.4

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.
@@ -27,6 +27,7 @@ class ChildCompilationPlugin {
27
27
  filename: resolvedDest
28
28
  };
29
29
  const childCompiler = compilation.createChildCompiler(this.constructor.name, outputOptions, []);
30
+ childCompiler.options.target = "webworker";
30
31
  childCompiler.context = parentCompiler.context;
31
32
  childCompiler.inputFileSystem = parentCompiler.inputFileSystem;
32
33
  childCompiler.outputFileSystem = parentCompiler.outputFileSystem;
package/dist/index.js CHANGED
@@ -240,8 +240,12 @@ class InjectManifest {
240
240
  if (error) {
241
241
  reject(error);
242
242
  } else {
243
- compilation.warnings = compilation.warnings.concat(childCompilation?.warnings ?? []);
244
- compilation.errors = compilation.errors.concat(childCompilation?.errors ?? []);
243
+ if (childCompilation?.warnings) {
244
+ compilation.warnings.push(...childCompilation.warnings);
245
+ }
246
+ if (childCompilation?.errors) {
247
+ compilation.errors.push(...childCompilation.errors);
248
+ }
245
249
  resolve();
246
250
  }
247
251
  });
@@ -1 +1 @@
1
- {"version":3,"file":"inject-manifest.d.ts","sourceRoot":"","sources":["../src/inject-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAe,QAAQ,EAAoC,MAAM,SAAS,CAAC;AACvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAW3F;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,cAAc;IACzB,SAAS,CAAC,MAAM,EAAE,6BAA6B,CAAC;IAChD,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO,CAAC,OAAO,CAAiB;IAEhC;;OAEG;gBACS,MAAM,EAAE,qBAAqB;IAOzC;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAa9B;;;;OAIG;YACW,kBAAkB;IAwChC;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IA6B/B;;;;;OAKG;YACW,uBAAuB;IAiCrC;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAKtB;;;;;OAKG;YACW,UAAU;IAiBxB;;;;OAIG;YACW,SAAS;CAmDxB"}
1
+ {"version":3,"file":"inject-manifest.d.ts","sourceRoot":"","sources":["../src/inject-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAe,QAAQ,EAAoC,MAAM,SAAS,CAAC;AACvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAW3F;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,cAAc;IACzB,SAAS,CAAC,MAAM,EAAE,6BAA6B,CAAC;IAChD,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO,CAAC,OAAO,CAAiB;IAEhC;;OAEG;gBACS,MAAM,EAAE,qBAAqB;IAOzC;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAa9B;;;;OAIG;YACW,kBAAkB;IAwChC;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IA6B/B;;;;;OAKG;YACW,uBAAuB;IAqCrC;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAKtB;;;;;OAKG;YACW,UAAU;IAiBxB;;;;OAIG;YACW,SAAS;CAmDxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-manifest-entries-from-compilation.d.ts","sourceRoot":"","sources":["../../src/lib/get-manifest-entries-from-compilation.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,KAAK,EAAgB,WAAW,EAAgB,MAAM,SAAS,CAAC;AAIvE,OAAO,KAAK,EAAyB,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAoKvF,eAAO,MAAM,iCAAiC,gBAC/B,WAAW,UAChB,6BAA6B,KACpC,QAAQ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,aAAa,EAAE,GAAG,SAAS,CAAA;CAAE,CAiCtE,CAAC"}
1
+ {"version":3,"file":"get-manifest-entries-from-compilation.d.ts","sourceRoot":"","sources":["../../src/lib/get-manifest-entries-from-compilation.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,KAAK,EAAgB,WAAW,EAAgB,MAAM,SAAS,CAAC;AAIvE,OAAO,KAAK,EAAyB,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAoKvF,eAAO,MAAM,iCAAiC,gBAC/B,WAAW,UAChB,6BAA6B,KACpC,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,aAAa,EAAE,GAAG,SAAS,CAAA;CAAE,CAiCtE,CAAC"}
@@ -28,11 +28,7 @@ export declare const injectPartial: z.ZodObject<{
28
28
  swDest?: string | undefined;
29
29
  webpackCompilationPlugins?: any[] | undefined;
30
30
  }>;
31
- export declare const injectManifestOptions: z.ZodObject<{
32
- chunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
33
- exclude: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodBoolean>]>, "many">>;
34
- excludeChunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
35
- include: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodBoolean>]>, "many">>;
31
+ export declare const injectManifestOptions: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
36
32
  additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
37
33
  integrity: z.ZodOptional<z.ZodString>;
38
34
  revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -48,12 +44,13 @@ export declare const injectManifestOptions: z.ZodObject<{
48
44
  }>]>, "many">>;
49
45
  disablePrecacheManifest: z.ZodDefault<z.ZodBoolean>;
50
46
  dontCacheBustURLsMatching: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
51
- manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<{
47
+ manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
52
48
  integrity: z.ZodOptional<z.ZodString>;
53
49
  revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
50
  url: z.ZodString;
51
+ }, {
55
52
  size: z.ZodNumber;
56
- }, "strip", z.ZodTypeAny, {
53
+ }>, "strip", z.ZodTypeAny, {
57
54
  url: string;
58
55
  size: number;
59
56
  integrity?: string | undefined;
@@ -64,12 +61,13 @@ export declare const injectManifestOptions: z.ZodObject<{
64
61
  integrity?: string | undefined;
65
62
  revision?: string | null | undefined;
66
63
  }>, "many">, z.ZodOptional<z.ZodUnknown>], null>, z.ZodUnion<[z.ZodPromise<z.ZodObject<{
67
- manifest: z.ZodArray<z.ZodObject<{
64
+ manifest: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
68
65
  integrity: z.ZodOptional<z.ZodString>;
69
66
  revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
70
67
  url: z.ZodString;
68
+ }, {
71
69
  size: z.ZodNumber;
72
- }, "strip", z.ZodTypeAny, {
70
+ }>, "strip", z.ZodTypeAny, {
73
71
  url: string;
74
72
  size: number;
75
73
  integrity?: string | undefined;
@@ -98,12 +96,13 @@ export declare const injectManifestOptions: z.ZodObject<{
98
96
  }[];
99
97
  warnings?: string[] | undefined;
100
98
  }>>, z.ZodObject<{
101
- manifest: z.ZodArray<z.ZodObject<{
99
+ manifest: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
102
100
  integrity: z.ZodOptional<z.ZodString>;
103
101
  revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
104
102
  url: z.ZodString;
103
+ }, {
105
104
  size: z.ZodNumber;
106
- }, "strip", z.ZodTypeAny, {
105
+ }>, "strip", z.ZodTypeAny, {
107
106
  url: string;
108
107
  size: number;
109
108
  integrity?: string | undefined;
@@ -134,12 +133,21 @@ export declare const injectManifestOptions: z.ZodObject<{
134
133
  }>]>>, "many">>;
135
134
  maximumFileSizeToCacheInBytes: z.ZodDefault<z.ZodNumber>;
136
135
  modifyURLPrefix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
136
+ }, {
137
+ chunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
138
+ exclude: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodBoolean>]>, "many">>;
139
+ excludeChunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
140
+ include: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodBoolean>]>, "many">>;
141
+ }>, {
137
142
  injectionPoint: z.ZodDefault<z.ZodString>;
138
143
  swSrc: z.ZodString;
144
+ }>, {
145
+ swDest: z.ZodOptional<z.ZodString>;
146
+ }>, {
139
147
  compileSrc: z.ZodDefault<z.ZodBoolean>;
140
148
  swDest: z.ZodOptional<z.ZodString>;
141
149
  webpackCompilationPlugins: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
142
- }, "strict", z.ZodTypeAny, {
150
+ }>, "strict", z.ZodTypeAny, {
143
151
  exclude: (string | RegExp | ((args_0: any) => boolean))[];
144
152
  compileSrc: boolean;
145
153
  disablePrecacheManifest: boolean;
@@ -149,6 +157,8 @@ export declare const injectManifestOptions: z.ZodObject<{
149
157
  chunks?: string[] | undefined;
150
158
  excludeChunks?: string[] | undefined;
151
159
  include?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
160
+ swDest?: string | undefined;
161
+ webpackCompilationPlugins?: any[] | undefined;
152
162
  additionalPrecacheEntries?: (string | {
153
163
  url: string;
154
164
  integrity?: string | undefined;
@@ -178,14 +188,15 @@ export declare const injectManifestOptions: z.ZodObject<{
178
188
  warnings?: string[] | undefined;
179
189
  }>)[] | undefined;
180
190
  modifyURLPrefix?: Record<string, string> | undefined;
181
- swDest?: string | undefined;
182
- webpackCompilationPlugins?: any[] | undefined;
183
191
  }, {
184
192
  swSrc: string;
185
193
  chunks?: string[] | undefined;
186
194
  exclude?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
187
195
  excludeChunks?: string[] | undefined;
188
196
  include?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
197
+ compileSrc?: boolean | undefined;
198
+ swDest?: string | undefined;
199
+ webpackCompilationPlugins?: any[] | undefined;
189
200
  additionalPrecacheEntries?: (string | {
190
201
  url: string;
191
202
  integrity?: string | undefined;
@@ -218,8 +229,5 @@ export declare const injectManifestOptions: z.ZodObject<{
218
229
  maximumFileSizeToCacheInBytes?: number | undefined;
219
230
  modifyURLPrefix?: Record<string, string> | undefined;
220
231
  injectionPoint?: string | undefined;
221
- compileSrc?: boolean | undefined;
222
- swDest?: string | undefined;
223
- webpackCompilationPlugins?: any[] | undefined;
224
232
  }>;
225
233
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/lib/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EASmC,CAAC;AAE/D,eAAO,MAAM,aAAa;;;;;;;;;;;;EAMkD,CAAC;AAE7E,eAAO,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vC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/lib/validator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAEhE,eAAO,MAAM,6BAA6B,UAAiB,OAAO,KAAG,QAAQ,6BAA6B,CAMzG,CAAC"}
1
+ {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/lib/validator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAEhE,eAAO,MAAM,6BAA6B,UAAiB,OAAO,KAAG,OAAO,CAAC,6BAA6B,CAMzG,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/webpack-plugin",
3
- "version": "9.0.2",
3
+ "version": "9.0.4",
4
4
  "type": "module",
5
5
  "description": "A plugin for your webpack build process, helping you generate a manifest of local files that should be precached.",
6
6
  "files": [
@@ -55,17 +55,17 @@
55
55
  "dependencies": {
56
56
  "pretty-bytes": "6.1.1",
57
57
  "upath": "2.0.1",
58
- "zod": "3.22.4",
59
- "@serwist/build": "9.0.2"
58
+ "zod": "3.23.8",
59
+ "@serwist/build": "9.0.4"
60
60
  },
61
61
  "devDependencies": {
62
- "@types/node": "20.12.7",
62
+ "@types/node": "20.14.10",
63
63
  "@types/webpack": "5.28.5",
64
- "rollup": "4.14.3",
65
- "typescript": "5.5.0-dev.20240415",
66
- "webpack": "5.91.0",
67
- "@serwist/configs": "9.0.2",
68
- "@serwist/utils": "9.0.2"
64
+ "rollup": "4.18.1",
65
+ "typescript": "5.5.3",
66
+ "webpack": "5.93.0",
67
+ "@serwist/utils": "9.0.4",
68
+ "@serwist/configs": "9.0.4"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "typescript": ">=5.0.0",
@@ -177,8 +177,12 @@ export class InjectManifest {
177
177
  if (error) {
178
178
  reject(error);
179
179
  } else {
180
- compilation.warnings = compilation.warnings.concat(childCompilation?.warnings ?? []);
181
- compilation.errors = compilation.errors.concat(childCompilation?.errors ?? []);
180
+ if (childCompilation?.warnings) {
181
+ compilation.warnings.push(...childCompilation.warnings);
182
+ }
183
+ if (childCompilation?.errors) {
184
+ compilation.errors.push(...childCompilation.errors);
185
+ }
182
186
 
183
187
  resolve();
184
188
  }
@@ -59,7 +59,7 @@ export class ChildCompilationPlugin implements WebpackPluginInstance {
59
59
  };
60
60
 
61
61
  const childCompiler = compilation.createChildCompiler(this.constructor.name, outputOptions, []);
62
-
62
+ childCompiler.options.target = "webworker";
63
63
  childCompiler.context = parentCompiler.context;
64
64
  childCompiler.inputFileSystem = parentCompiler.inputFileSystem;
65
65
  childCompiler.outputFileSystem = parentCompiler.outputFileSystem;