webpack 5.99.4 → 5.99.6

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.
Files changed (87) hide show
  1. package/README.md +1 -1
  2. package/lib/APIPlugin.js +2 -2
  3. package/lib/Cache.js +1 -1
  4. package/lib/Chunk.js +12 -9
  5. package/lib/Compilation.js +36 -27
  6. package/lib/Compiler.js +4 -3
  7. package/lib/ContextModule.js +2 -1
  8. package/lib/HotModuleReplacementPlugin.js +3 -3
  9. package/lib/Module.js +10 -2
  10. package/lib/ModuleFilenameHelpers.js +1 -1
  11. package/lib/ModuleGraph.js +15 -10
  12. package/lib/NormalModule.js +1 -1
  13. package/lib/PrefetchPlugin.js +1 -1
  14. package/lib/RecordIdsPlugin.js +1 -1
  15. package/lib/SourceMapDevToolPlugin.js +1 -1
  16. package/lib/Template.js +1 -1
  17. package/lib/WebpackOptionsApply.js +17 -2
  18. package/lib/buildChunkGraph.js +7 -2
  19. package/lib/cache/IdleFileCachePlugin.js +1 -1
  20. package/lib/cache/MemoryCachePlugin.js +2 -1
  21. package/lib/cache/MemoryWithGcCachePlugin.js +3 -2
  22. package/lib/cache/PackFileCacheStrategy.js +13 -21
  23. package/lib/cache/ResolverCachePlugin.js +14 -16
  24. package/lib/cli.js +3 -3
  25. package/lib/config/defaults.js +2 -2
  26. package/lib/config/target.js +6 -6
  27. package/lib/css/CssParser.js +1 -1
  28. package/lib/debug/ProfilingPlugin.js +1 -1
  29. package/lib/dependencies/ContextDependencyHelpers.js +1 -1
  30. package/lib/dependencies/CssIcssImportDependency.js +3 -2
  31. package/lib/dependencies/HarmonyExportExpressionDependency.js +1 -1
  32. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +2 -1
  33. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +1 -1
  34. package/lib/dependencies/JsonExportsDependency.js +1 -1
  35. package/lib/dependencies/LocalModulesHelpers.js +1 -1
  36. package/lib/dependencies/RequireResolveDependency.js +1 -1
  37. package/lib/dependencies/WorkerPlugin.js +2 -2
  38. package/lib/esm/ModuleChunkLoadingPlugin.js +20 -0
  39. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +11 -9
  40. package/lib/ids/DeterministicChunkIdsPlugin.js +1 -1
  41. package/lib/ids/DeterministicModuleIdsPlugin.js +1 -1
  42. package/lib/ids/NamedChunkIdsPlugin.js +2 -2
  43. package/lib/ids/NamedModuleIdsPlugin.js +2 -2
  44. package/lib/index.js +1 -1
  45. package/lib/javascript/BasicEvaluatedExpression.js +2 -2
  46. package/lib/javascript/JavascriptParser.js +66 -72
  47. package/lib/library/EnableLibraryPlugin.js +15 -2
  48. package/lib/library/ModuleLibraryPlugin.js +6 -1
  49. package/lib/logging/createConsoleLogger.js +0 -1
  50. package/lib/node/CommonJsChunkLoadingPlugin.js +2 -2
  51. package/lib/node/NodeTemplatePlugin.js +2 -2
  52. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +2 -2
  53. package/lib/node/ReadFileCompileWasmPlugin.js +3 -3
  54. package/lib/optimize/AggressiveMergingPlugin.js +1 -1
  55. package/lib/optimize/SplitChunksPlugin.js +2 -1
  56. package/lib/runtime/GetChunkFilenameRuntimeModule.js +3 -4
  57. package/lib/serialization/BinaryMiddleware.js +22 -38
  58. package/lib/serialization/FileMiddleware.js +29 -33
  59. package/lib/serialization/ObjectMiddleware.js +29 -30
  60. package/lib/serialization/Serializer.js +29 -18
  61. package/lib/serialization/SerializerMiddleware.js +105 -72
  62. package/lib/serialization/SingleItemMiddleware.js +4 -5
  63. package/lib/stats/DefaultStatsFactoryPlugin.js +39 -24
  64. package/lib/stats/DefaultStatsPrinterPlugin.js +267 -80
  65. package/lib/stats/StatsFactory.js +47 -10
  66. package/lib/stats/StatsPrinter.js +52 -31
  67. package/lib/util/ArrayQueue.js +1 -1
  68. package/lib/util/AsyncQueue.js +1 -1
  69. package/lib/util/TupleQueue.js +9 -7
  70. package/lib/util/TupleSet.js +37 -18
  71. package/lib/util/WeakTupleMap.js +50 -37
  72. package/lib/util/cleverMerge.js +2 -2
  73. package/lib/util/comparators.js +1 -1
  74. package/lib/util/createHash.js +1 -1
  75. package/lib/util/fs.js +1 -1
  76. package/lib/util/makeSerializable.js +1 -1
  77. package/lib/util/runtime.js +1 -0
  78. package/lib/util/serialization.js +50 -42
  79. package/lib/wasm-async/AsyncWebAssemblyGenerator.js +1 -1
  80. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +1 -1
  81. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +2 -2
  82. package/lib/wasm-sync/WebAssemblyGenerator.js +1 -1
  83. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +1 -1
  84. package/lib/web/FetchCompileWasmPlugin.js +2 -2
  85. package/lib/webpack.js +1 -1
  86. package/package.json +1 -1
  87. package/types.d.ts +125 -74
@@ -6,15 +6,15 @@
6
6
  "use strict";
7
7
 
8
8
  /**
9
- * @template T
9
+ * @template {EXPECTED_ANY[]} T
10
10
  * @template V
11
- * @typedef {Map<EXPECTED_ANY, WeakTupleMap<T[], V>>} M
11
+ * @typedef {Map<EXPECTED_ANY, WeakTupleMap<T, V>>} M
12
12
  */
13
13
 
14
14
  /**
15
- * @template T
15
+ * @template {EXPECTED_ANY[]} T
16
16
  * @template V
17
- * @typedef {WeakMap<EXPECTED_OBJECT, WeakTupleMap<T[], V>>} W
17
+ * @typedef {WeakMap<EXPECTED_OBJECT, WeakTupleMap<T, V>>} W
18
18
  */
19
19
 
20
20
  /**
@@ -24,7 +24,12 @@
24
24
  const isWeakKey = thing => typeof thing === "object" && thing !== null;
25
25
 
26
26
  /**
27
- * @template {any[]} T
27
+ * @template {unknown[]} T
28
+ * @typedef {T extends readonly (infer ElementType)[] ? ElementType : never} ArrayElement
29
+ */
30
+
31
+ /**
32
+ * @template {EXPECTED_ANY[]} K
28
33
  * @template V
29
34
  */
30
35
  class WeakTupleMap {
@@ -38,83 +43,83 @@ class WeakTupleMap {
38
43
  this.v = undefined;
39
44
  /**
40
45
  * @private
41
- * @type {M<T, V> | undefined}
46
+ * @type {M<K, V> | undefined}
42
47
  */
43
48
  this.m = undefined;
44
49
  /**
45
50
  * @private
46
- * @type {W<T, V> | undefined}
51
+ * @type {W<K, V> | undefined}
47
52
  */
48
53
  this.w = undefined;
49
54
  }
50
55
 
51
56
  /**
52
- * @param {[...T, V]} args tuple
57
+ * @param {[...K, V]} args tuple
53
58
  * @returns {void}
54
59
  */
55
60
  set(...args) {
56
- /** @type {WeakTupleMap<T, V>} */
61
+ /** @type {WeakTupleMap<K, V>} */
57
62
  let node = this;
58
63
  for (let i = 0; i < args.length - 1; i++) {
59
- node = node._get(args[i]);
64
+ node = node._get(/** @type {ArrayElement<K>} */ (args[i]));
60
65
  }
61
- node._setValue(args[args.length - 1]);
66
+ node._setValue(/** @type {V} */ (args[args.length - 1]));
62
67
  }
63
68
 
64
69
  /**
65
- * @param {T} args tuple
70
+ * @param {K} args tuple
66
71
  * @returns {boolean} true, if the tuple is in the Set
67
72
  */
68
73
  has(...args) {
69
- /** @type {WeakTupleMap<T, V> | undefined} */
74
+ /** @type {WeakTupleMap<K, V> | undefined} */
70
75
  let node = this;
71
76
  for (let i = 0; i < args.length; i++) {
72
- node = node._peek(args[i]);
77
+ node = node._peek(/** @type {ArrayElement<K>} */ (args[i]));
73
78
  if (node === undefined) return false;
74
79
  }
75
80
  return node._hasValue();
76
81
  }
77
82
 
78
83
  /**
79
- * @param {T} args tuple
84
+ * @param {K} args tuple
80
85
  * @returns {V | undefined} the value
81
86
  */
82
87
  get(...args) {
83
- /** @type {WeakTupleMap<T, V> | undefined} */
88
+ /** @type {WeakTupleMap<K, V> | undefined} */
84
89
  let node = this;
85
90
  for (let i = 0; i < args.length; i++) {
86
- node = node._peek(args[i]);
91
+ node = node._peek(/** @type {ArrayElement<K>} */ (args[i]));
87
92
  if (node === undefined) return;
88
93
  }
89
94
  return node._getValue();
90
95
  }
91
96
 
92
97
  /**
93
- * @param {[...T, () => V]} args tuple
98
+ * @param {[...K, (...args: K) => V]} args tuple
94
99
  * @returns {V} the value
95
100
  */
96
101
  provide(...args) {
97
- /** @type {WeakTupleMap<T, V>} */
102
+ /** @type {WeakTupleMap<K, V>} */
98
103
  let node = this;
99
104
  for (let i = 0; i < args.length - 1; i++) {
100
- node = node._get(args[i]);
105
+ node = node._get(/** @type {ArrayElement<K>} */ (args[i]));
101
106
  }
102
107
  if (node._hasValue()) return /** @type {V} */ (node._getValue());
103
- const fn = args[args.length - 1];
104
- const newValue = fn(...args.slice(0, -1));
108
+ const fn = /** @type {(...args: K) => V} */ (args[args.length - 1]);
109
+ const newValue = fn(.../** @type {K} */ (args.slice(0, -1)));
105
110
  node._setValue(newValue);
106
111
  return newValue;
107
112
  }
108
113
 
109
114
  /**
110
- * @param {T} args tuple
115
+ * @param {K} args tuple
111
116
  * @returns {void}
112
117
  */
113
118
  delete(...args) {
114
- /** @type {WeakTupleMap<T, V> | undefined} */
119
+ /** @type {WeakTupleMap<K, V> | undefined} */
115
120
  let node = this;
116
121
  for (let i = 0; i < args.length; i++) {
117
- node = node._peek(args[i]);
122
+ node = node._peek(/** @type {ArrayElement<K>} */ (args[i]));
118
123
  if (node === undefined) return;
119
124
  }
120
125
  node._deleteValue();
@@ -153,59 +158,67 @@ class WeakTupleMap {
153
158
  }
154
159
 
155
160
  /**
156
- * @param {EXPECTED_ANY} thing thing
157
- * @returns {WeakTupleMap<T, V> | undefined} thing
161
+ * @param {ArrayElement<K>} thing thing
162
+ * @returns {WeakTupleMap<K, V> | undefined} thing
158
163
  * @private
159
164
  */
160
165
  _peek(thing) {
161
166
  if (isWeakKey(thing)) {
162
167
  if ((this.f & 4) !== 4) return;
163
- return /** @type {W<T, V>} */ (this.w).get(thing);
168
+ return /** @type {WeakMap<ArrayElement<K>, WeakTupleMap<K, V>>} */ (
169
+ this.w
170
+ ).get(thing);
164
171
  }
165
172
  if ((this.f & 2) !== 2) return;
166
- return /** @type {M<T, V>} */ (this.m).get(thing);
173
+ return /** @type {Map<ArrayElement<K>, WeakTupleMap<K, V>>} */ (this.m).get(
174
+ thing
175
+ );
167
176
  }
168
177
 
169
178
  /**
170
179
  * @private
171
- * @param {EXPECTED_ANY} thing thing
172
- * @returns {WeakTupleMap<T, V>} value
180
+ * @param {ArrayElement<K>} thing thing
181
+ * @returns {WeakTupleMap<K, V>} value
173
182
  */
174
183
  _get(thing) {
175
184
  if (isWeakKey(thing)) {
176
185
  if ((this.f & 4) !== 4) {
186
+ /** @type {W<K, V>} */
177
187
  const newMap = new WeakMap();
178
188
  this.f |= 4;
189
+ /** @type {WeakTupleMap<K, V>} */
179
190
  const newNode = new WeakTupleMap();
180
191
  (this.w = newMap).set(thing, newNode);
181
192
  return newNode;
182
193
  }
183
- const entry =
184
- /** @type {W<T, V>} */
185
- (this.w).get(thing);
194
+ const entry = /** @type {W<K, V>} */ (this.w).get(thing);
186
195
  if (entry !== undefined) {
187
196
  return entry;
188
197
  }
198
+ /** @type {WeakTupleMap<K, V>} */
189
199
  const newNode = new WeakTupleMap();
190
- /** @type {W<T, V>} */
200
+ /** @type {W<K, V>} */
191
201
  (this.w).set(thing, newNode);
192
202
  return newNode;
193
203
  }
194
204
  if ((this.f & 2) !== 2) {
205
+ /** @type {M<K, V>} */
195
206
  const newMap = new Map();
196
207
  this.f |= 2;
208
+ /** @type {WeakTupleMap<K, V>} */
197
209
  const newNode = new WeakTupleMap();
198
210
  (this.m = newMap).set(thing, newNode);
199
211
  return newNode;
200
212
  }
201
213
  const entry =
202
- /** @type {M<T, V>} */
214
+ /** @type {M<K, V>} */
203
215
  (this.m).get(thing);
204
216
  if (entry !== undefined) {
205
217
  return entry;
206
218
  }
219
+ /** @type {WeakTupleMap<K, V>} */
207
220
  const newNode = new WeakTupleMap();
208
- /** @type {M<T, V>} */
221
+ /** @type {M<K, V>} */
209
222
  (this.m).set(thing, newNode);
210
223
  return newNode;
211
224
  }
@@ -89,9 +89,9 @@ const cachedSetProperty = (obj, property, value) => {
89
89
 
90
90
  /**
91
91
  * @typedef {object} ObjectParsedPropertyEntry
92
- * @property {any | undefined} base base value
92
+ * @property {TODO | undefined} base base value
93
93
  * @property {string | undefined} byProperty the name of the selector property
94
- * @property {ByValues<any>} byValues value depending on selector property, merged with base
94
+ * @property {ByValues<TODO>} byValues value depending on selector property, merged with base
95
95
  */
96
96
 
97
97
  /** @typedef {(function(...EXPECTED_ANY): object) & { [DYNAMIC_INFO]: [DynamicFunction, object] }} DynamicFunction */
@@ -361,7 +361,7 @@ module.exports.concatComparators = concatComparators;
361
361
  * @typedef {(input: A) => B | undefined | null} Selector
362
362
  */
363
363
 
364
- /** @type {TwoKeyWeakMap<Selector<any, any>, Comparator<any>, Comparator<any>>}} */
364
+ /** @type {TwoKeyWeakMap<Selector<EXPECTED_ANY, EXPECTED_ANY>, Comparator<EXPECTED_ANY>, Comparator<EXPECTED_ANY>>}} */
365
365
  const compareSelectCache = new TwoKeyWeakMap();
366
366
 
367
367
  /**
@@ -19,7 +19,7 @@ const digestCaches = {};
19
19
  class BulkUpdateDecorator extends Hash {
20
20
  /**
21
21
  * @param {Hash | HashFactory} hashOrFactory function to create a hash
22
- * @param {string} [hashKey] key for caching
22
+ * @param {string=} hashKey key for caching
23
23
  */
24
24
  constructor(hashOrFactory, hashKey) {
25
25
  super();
package/lib/util/fs.js CHANGED
@@ -129,7 +129,7 @@ const path = require("path");
129
129
 
130
130
  /**
131
131
  * @typedef {object} ObjectEncodingOptions
132
- * @property {BufferEncoding | null | undefined} [encoding]
132
+ * @property {BufferEncoding | null | undefined=} encoding
133
133
  */
134
134
 
135
135
  /**
@@ -53,7 +53,7 @@ class ClassSerializer {
53
53
  * @template {Constructor} T
54
54
  * @param {T} Constructor the constructor
55
55
  * @param {string} request the request which will be required when deserializing
56
- * @param {string | null} [name] the name to make multiple serializer unique when sharing a request
56
+ * @param {string | null=} name the name to make multiple serializer unique when sharing a request
57
57
  */
58
58
  module.exports = (Constructor, request, name = null) => {
59
59
  register(Constructor, request, name, new ClassSerializer(Constructor));
@@ -431,6 +431,7 @@ class RuntimeSpecMap {
431
431
  * @param {RuntimeSpecMap<T, R>=} clone copy form this
432
432
  */
433
433
  constructor(clone) {
434
+ /** @type {0 | 1 | 2} */
434
435
  this._mode = clone ? clone._mode : 0; // 0 = empty, 1 = single entry, 2 = map
435
436
  /** @type {RuntimeSpec} */
436
437
  this._singleRuntime = clone ? clone._singleRuntime : undefined;
@@ -9,10 +9,14 @@ const memoize = require("./memoize");
9
9
 
10
10
  /** @typedef {import("../serialization/BinaryMiddleware").MEASURE_END_OPERATION_TYPE} MEASURE_END_OPERATION */
11
11
  /** @typedef {import("../serialization/BinaryMiddleware").MEASURE_START_OPERATION_TYPE} MEASURE_START_OPERATION */
12
- /** @typedef {import("../serialization/Serializer")} Serializer */
13
12
  /** @typedef {typeof import("../util/Hash")} Hash */
14
13
  /** @typedef {import("../util/fs").IntermediateFileSystem} IntermediateFileSystem */
15
14
 
15
+ /**
16
+ * @template D, S, C
17
+ * @typedef {import("../serialization/Serializer")<D, S, C>} Serializer
18
+ */
19
+
16
20
  const getBinaryMiddleware = memoize(() =>
17
21
  require("../serialization/BinaryMiddleware")
18
22
  );
@@ -53,7 +57,9 @@ const registerSerializers = memoize(() => {
53
57
  });
54
58
  });
55
59
 
56
- /** @type {Serializer} */
60
+ /**
61
+ * @type {Serializer<EXPECTED_ANY, EXPECTED_ANY, EXPECTED_ANY>}
62
+ */
57
63
  let buffersSerializer;
58
64
 
59
65
  // Expose serialization API
@@ -78,9 +84,6 @@ module.exports = {
78
84
  get MEASURE_END_OPERATION() {
79
85
  return getBinaryMiddleware().MEASURE_END_OPERATION;
80
86
  },
81
- /**
82
- * @returns {Serializer} buffer serializer
83
- */
84
87
  get buffersSerializer() {
85
88
  if (buffersSerializer !== undefined) return buffersSerializer;
86
89
  registerSerializers();
@@ -88,24 +91,27 @@ module.exports = {
88
91
  const binaryMiddleware = getBinaryMiddlewareInstance();
89
92
  const SerializerMiddleware = getSerializerMiddleware();
90
93
  const SingleItemMiddleware = getSingleItemMiddleware();
91
- return (buffersSerializer = new Serializer([
92
- new SingleItemMiddleware(),
93
- new (getObjectMiddleware())(context => {
94
- if ("write" in context) {
95
- context.writeLazy = value => {
96
- context.write(
97
- SerializerMiddleware.createLazy(value, binaryMiddleware)
98
- );
99
- };
100
- }
101
- }, DEFAULTS.HASH_FUNCTION),
102
- binaryMiddleware
103
- ]));
94
+ return /** @type {Serializer<EXPECTED_ANY, EXPECTED_ANY, EXPECTED_ANY>} */ (
95
+ buffersSerializer = new Serializer([
96
+ new SingleItemMiddleware(),
97
+ new (getObjectMiddleware())(context => {
98
+ if ("write" in context) {
99
+ context.writeLazy = value => {
100
+ context.write(
101
+ SerializerMiddleware.createLazy(value, binaryMiddleware)
102
+ );
103
+ };
104
+ }
105
+ }, DEFAULTS.HASH_FUNCTION),
106
+ binaryMiddleware
107
+ ])
108
+ );
104
109
  },
105
110
  /**
111
+ * @template D, S, C
106
112
  * @param {IntermediateFileSystem} fs filesystem
107
113
  * @param {string | Hash} hashFunction hash function to use
108
- * @returns {Serializer} file serializer
114
+ * @returns {Serializer<D, S, C>} file serializer
109
115
  */
110
116
  createFileSerializer: (fs, hashFunction) => {
111
117
  registerSerializers();
@@ -115,28 +121,30 @@ module.exports = {
115
121
  const binaryMiddleware = getBinaryMiddlewareInstance();
116
122
  const SerializerMiddleware = getSerializerMiddleware();
117
123
  const SingleItemMiddleware = getSingleItemMiddleware();
118
- return new Serializer([
119
- new SingleItemMiddleware(),
120
- new (getObjectMiddleware())(context => {
121
- if ("write" in context) {
122
- context.writeLazy = value => {
123
- context.write(
124
- SerializerMiddleware.createLazy(value, binaryMiddleware)
125
- );
126
- };
127
- context.writeSeparate = (value, options) => {
128
- const lazy = SerializerMiddleware.createLazy(
129
- value,
130
- fileMiddleware,
131
- options
132
- );
133
- context.write(lazy);
134
- return lazy;
135
- };
136
- }
137
- }, hashFunction),
138
- binaryMiddleware,
139
- fileMiddleware
140
- ]);
124
+ return /** @type {Serializer<D, S, C>} */ (
125
+ new Serializer([
126
+ new SingleItemMiddleware(),
127
+ new (getObjectMiddleware())(context => {
128
+ if ("write" in context) {
129
+ context.writeLazy = value => {
130
+ context.write(
131
+ SerializerMiddleware.createLazy(value, binaryMiddleware)
132
+ );
133
+ };
134
+ context.writeSeparate = (value, options) => {
135
+ const lazy = SerializerMiddleware.createLazy(
136
+ value,
137
+ fileMiddleware,
138
+ options
139
+ );
140
+ context.write(lazy);
141
+ return lazy;
142
+ };
143
+ }
144
+ }, hashFunction),
145
+ binaryMiddleware,
146
+ fileMiddleware
147
+ ])
148
+ );
141
149
  }
142
150
  };
@@ -16,7 +16,7 @@ const { WEBASSEMBLY_TYPES } = require("../ModuleSourceTypesConstants");
16
16
 
17
17
  /**
18
18
  * @typedef {object} AsyncWebAssemblyGeneratorOptions
19
- * @property {boolean} [mangleImports] mangle imports
19
+ * @property {boolean=} mangleImports mangle imports
20
20
  */
21
21
 
22
22
  class AsyncWebAssemblyGenerator extends Generator {
@@ -55,7 +55,7 @@ const getAsyncWebAssemblyParser = memoize(() =>
55
55
 
56
56
  /**
57
57
  * @typedef {object} AsyncWebAssemblyModulesPluginOptions
58
- * @property {boolean} [mangleImports] mangle imports
58
+ * @property {boolean=} mangleImports mangle imports
59
59
  */
60
60
 
61
61
  /** @type {WeakMap<Compilation, CompilationHooks>} */
@@ -213,8 +213,8 @@ const generateImportObject = (
213
213
  /**
214
214
  * @typedef {object} WasmChunkLoadingRuntimeModuleOptions
215
215
  * @property {(path: string) => string} generateLoadBinaryCode
216
- * @property {boolean} [supportsStreaming]
217
- * @property {boolean} [mangleImports]
216
+ * @property {boolean=} supportsStreaming
217
+ * @property {boolean=} mangleImports
218
218
  * @property {ReadOnlyRuntimeRequirements} runtimeRequirements
219
219
  */
220
220
 
@@ -407,7 +407,7 @@ const getUsedDependencyMap = (moduleGraph, module, mangle) => {
407
407
 
408
408
  /**
409
409
  * @typedef {object} WebAssemblyGeneratorOptions
410
- * @property {boolean} [mangleImports] mangle imports
410
+ * @property {boolean=} mangleImports mangle imports
411
411
  */
412
412
 
413
413
  class WebAssemblyGenerator extends Generator {
@@ -32,7 +32,7 @@ const PLUGIN_NAME = "WebAssemblyModulesPlugin";
32
32
 
33
33
  /**
34
34
  * @typedef {object} WebAssemblyModulesPluginOptions
35
- * @property {boolean} [mangleImports] mangle imports
35
+ * @property {boolean=} mangleImports mangle imports
36
36
  */
37
37
 
38
38
  class WebAssemblyModulesPlugin {
@@ -14,7 +14,7 @@ const WasmChunkLoadingRuntimeModule = require("../wasm-sync/WasmChunkLoadingRunt
14
14
 
15
15
  /**
16
16
  * @typedef {object} FetchCompileWasmPluginOptions
17
- * @property {boolean} [mangleImports] mangle imports
17
+ * @property {boolean=} mangleImports mangle imports
18
18
  */
19
19
 
20
20
  // TODO webpack 6 remove
@@ -23,7 +23,7 @@ const PLUGIN_NAME = "FetchCompileWasmPlugin";
23
23
 
24
24
  class FetchCompileWasmPlugin {
25
25
  /**
26
- * @param {FetchCompileWasmPluginOptions} [options] options
26
+ * @param {FetchCompileWasmPluginOptions=} options options
27
27
  */
28
28
  constructor(options = {}) {
29
29
  this.options = options;
package/lib/webpack.js CHANGED
@@ -59,7 +59,7 @@ const createMultiCompiler = (childOptions, options) => {
59
59
 
60
60
  /**
61
61
  * @param {WebpackOptions} rawOptions options object
62
- * @param {number} [compilerIndex] index of compiler
62
+ * @param {number=} compilerIndex index of compiler
63
63
  * @returns {Compiler} a compiler
64
64
  */
65
65
  const createCompiler = (rawOptions, compilerIndex) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "5.99.4",
3
+ "version": "5.99.6",
4
4
  "author": "Tobias Koppers @sokra",
5
5
  "description": "Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
6
6
  "license": "MIT",