webpack 5.100.2 → 5.101.1

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 (309) hide show
  1. package/README.md +12 -10
  2. package/bin/webpack.js +7 -7
  3. package/lib/APIPlugin.js +12 -14
  4. package/lib/AutomaticPrefetchPlugin.js +2 -2
  5. package/lib/BannerPlugin.js +4 -4
  6. package/lib/Cache.js +1 -1
  7. package/lib/CacheFacade.js +7 -7
  8. package/lib/CaseSensitiveModulesWarning.js +2 -2
  9. package/lib/Chunk.js +3 -3
  10. package/lib/ChunkGraph.js +63 -18
  11. package/lib/ChunkGroup.js +4 -4
  12. package/lib/CleanPlugin.js +19 -53
  13. package/lib/CodeGenerationResults.js +3 -3
  14. package/lib/CompatibilityPlugin.js +6 -6
  15. package/lib/Compilation.js +168 -116
  16. package/lib/Compiler.js +37 -37
  17. package/lib/ConcatenationScope.js +39 -1
  18. package/lib/ConstPlugin.js +11 -11
  19. package/lib/ContextExclusionPlugin.js +3 -3
  20. package/lib/ContextModule.js +12 -11
  21. package/lib/ContextModuleFactory.js +11 -11
  22. package/lib/ContextReplacementPlugin.js +5 -5
  23. package/lib/DefinePlugin.js +24 -22
  24. package/lib/DelegatedModuleFactoryPlugin.js +1 -1
  25. package/lib/Dependency.js +2 -1
  26. package/lib/DllEntryPlugin.js +1 -1
  27. package/lib/DllReferencePlugin.js +1 -1
  28. package/lib/DynamicEntryPlugin.js +3 -3
  29. package/lib/EntryPlugin.js +1 -1
  30. package/lib/EnvironmentPlugin.js +1 -1
  31. package/lib/ErrorHelpers.js +2 -2
  32. package/lib/EvalDevToolModulePlugin.js +2 -2
  33. package/lib/EvalSourceMapDevToolPlugin.js +5 -5
  34. package/lib/ExportsInfo.js +9 -9
  35. package/lib/ExportsInfoApiPlugin.js +2 -2
  36. package/lib/ExternalModule.js +163 -48
  37. package/lib/ExternalModuleFactoryPlugin.js +2 -2
  38. package/lib/ExternalsPlugin.js +45 -0
  39. package/lib/FileSystemInfo.js +64 -61
  40. package/lib/FlagAllModulesAsUsedPlugin.js +2 -2
  41. package/lib/FlagDependencyExportsPlugin.js +7 -7
  42. package/lib/FlagDependencyUsagePlugin.js +4 -4
  43. package/lib/FlagEntryExportAsUsedPlugin.js +1 -1
  44. package/lib/HotModuleReplacementPlugin.js +27 -27
  45. package/lib/IgnorePlugin.js +3 -3
  46. package/lib/IgnoreWarningsPlugin.js +4 -4
  47. package/lib/InitFragment.js +6 -0
  48. package/lib/InvalidDependenciesModuleWarning.js +1 -1
  49. package/lib/JavascriptMetaInfoPlugin.js +1 -1
  50. package/lib/LibManifestPlugin.js +2 -2
  51. package/lib/LoaderOptionsPlugin.js +1 -1
  52. package/lib/LoaderTargetPlugin.js +2 -2
  53. package/lib/MainTemplate.js +1 -1
  54. package/lib/Module.js +3 -2
  55. package/lib/ModuleFilenameHelpers.js +3 -3
  56. package/lib/ModuleGraph.js +23 -38
  57. package/lib/ModuleInfoHeaderPlugin.js +3 -3
  58. package/lib/ModuleParseError.js +5 -3
  59. package/lib/ModuleTemplate.js +3 -2
  60. package/lib/MultiCompiler.js +29 -24
  61. package/lib/MultiStats.js +18 -13
  62. package/lib/MultiWatching.js +1 -1
  63. package/lib/NoEmitOnErrorsPlugin.js +2 -2
  64. package/lib/NodeStuffPlugin.js +27 -15
  65. package/lib/NormalModule.js +23 -23
  66. package/lib/NormalModuleFactory.js +23 -21
  67. package/lib/NormalModuleReplacementPlugin.js +3 -3
  68. package/lib/PrefetchPlugin.js +1 -1
  69. package/lib/ProgressPlugin.js +11 -11
  70. package/lib/ProvidePlugin.js +2 -2
  71. package/lib/RecordIdsPlugin.js +3 -3
  72. package/lib/ResolverFactory.js +3 -3
  73. package/lib/RuntimeGlobals.js +20 -0
  74. package/lib/RuntimePlugin.js +16 -16
  75. package/lib/RuntimeTemplate.js +35 -26
  76. package/lib/SizeFormatHelpers.js +1 -1
  77. package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -4
  78. package/lib/SourceMapDevToolPlugin.js +9 -9
  79. package/lib/Stats.js +2 -2
  80. package/lib/Template.js +1 -1
  81. package/lib/TemplatedPathPlugin.js +2 -2
  82. package/lib/UseStrictPlugin.js +1 -1
  83. package/lib/WarnCaseSensitiveModulesPlugin.js +1 -1
  84. package/lib/WarnDeprecatedOptionPlugin.js +1 -1
  85. package/lib/WarnNoModeSetPlugin.js +1 -1
  86. package/lib/WatchIgnorePlugin.js +2 -2
  87. package/lib/Watching.js +12 -14
  88. package/lib/WebpackIsIncludedPlugin.js +2 -2
  89. package/lib/WebpackOptionsApply.js +3 -3
  90. package/lib/asset/AssetGenerator.js +1 -1
  91. package/lib/asset/AssetModulesPlugin.js +6 -6
  92. package/lib/async-modules/AsyncModuleHelpers.js +1 -1
  93. package/lib/async-modules/AwaitDependenciesInitFragment.js +36 -24
  94. package/lib/async-modules/InferAsyncModulesPlugin.js +3 -3
  95. package/lib/buildChunkGraph.js +5 -5
  96. package/lib/cache/AddBuildDependenciesPlugin.js +1 -1
  97. package/lib/cache/IdleFileCachePlugin.js +5 -5
  98. package/lib/cache/PackFileCacheStrategy.js +20 -20
  99. package/lib/cache/ResolverCachePlugin.js +4 -4
  100. package/lib/cli.js +196 -14
  101. package/lib/config/browserslistTargetHandler.js +6 -6
  102. package/lib/config/defaults.js +23 -14
  103. package/lib/config/normalization.js +41 -38
  104. package/lib/config/target.js +4 -4
  105. package/lib/container/ContainerEntryModule.js +3 -3
  106. package/lib/container/ContainerPlugin.js +3 -3
  107. package/lib/container/ContainerReferencePlugin.js +3 -3
  108. package/lib/container/FallbackModule.js +1 -1
  109. package/lib/container/HoistContainerReferencesPlugin.js +7 -7
  110. package/lib/container/options.js +4 -4
  111. package/lib/css/CssGenerator.js +5 -3
  112. package/lib/css/CssLoadingRuntimeModule.js +1 -1
  113. package/lib/css/CssModulesPlugin.js +25 -22
  114. package/lib/css/CssParser.js +5 -5
  115. package/lib/css/walkCssTokens.js +9 -9
  116. package/lib/debug/ProfilingPlugin.js +5 -5
  117. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +4 -4
  118. package/lib/dependencies/AMDPlugin.js +3 -3
  119. package/lib/dependencies/AMDRequireArrayDependency.js +1 -1
  120. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +3 -3
  121. package/lib/dependencies/CommonJsExportRequireDependency.js +2 -2
  122. package/lib/dependencies/CommonJsExportsParserPlugin.js +12 -10
  123. package/lib/dependencies/CommonJsImportsParserPlugin.js +21 -19
  124. package/lib/dependencies/CommonJsPlugin.js +2 -2
  125. package/lib/dependencies/ContextDependency.js +1 -1
  126. package/lib/dependencies/ContextDependencyHelpers.js +3 -3
  127. package/lib/dependencies/CssIcssExportDependency.js +2 -2
  128. package/lib/dependencies/CssLocalIdentifierDependency.js +2 -2
  129. package/lib/dependencies/CssUrlDependency.js +4 -4
  130. package/lib/dependencies/DynamicExports.js +5 -5
  131. package/lib/dependencies/HarmonyAcceptDependency.js +91 -5
  132. package/lib/dependencies/HarmonyDetectionParserPlugin.js +2 -2
  133. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +17 -13
  134. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +7 -8
  135. package/lib/dependencies/HarmonyExportInitFragment.js +1 -1
  136. package/lib/dependencies/HarmonyExports.js +1 -1
  137. package/lib/dependencies/HarmonyImportDependency.js +28 -9
  138. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +56 -48
  139. package/lib/dependencies/HarmonyImportSideEffectDependency.js +4 -5
  140. package/lib/dependencies/HarmonyImportSpecifierDependency.js +3 -4
  141. package/lib/dependencies/HarmonyModulesPlugin.js +2 -8
  142. package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +1 -1
  143. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +4 -4
  144. package/lib/dependencies/ImportMetaPlugin.js +7 -7
  145. package/lib/dependencies/ImportParserPlugin.js +4 -4
  146. package/lib/dependencies/JsonExportsDependency.js +7 -2
  147. package/lib/dependencies/LoaderPlugin.js +4 -4
  148. package/lib/dependencies/ModuleDependency.js +2 -1
  149. package/lib/dependencies/ProvidedDependency.js +2 -2
  150. package/lib/dependencies/PureExpressionDependency.js +1 -1
  151. package/lib/dependencies/RequireContextDependencyParserPlugin.js +1 -1
  152. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +1 -1
  153. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +3 -3
  154. package/lib/dependencies/SystemPlugin.js +3 -3
  155. package/lib/dependencies/WorkerPlugin.js +5 -5
  156. package/lib/dependencies/getFunctionExpression.js +1 -1
  157. package/lib/esm/ExportWebpackRequireRuntimeModule.js +8 -1
  158. package/lib/esm/ModuleChunkFormatPlugin.js +35 -69
  159. package/lib/esm/ModuleChunkLoadingPlugin.js +3 -6
  160. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +15 -11
  161. package/lib/formatLocation.js +2 -2
  162. package/lib/hmr/HotModuleReplacement.runtime.js +39 -27
  163. package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +43 -32
  164. package/lib/hmr/JavascriptHotModuleReplacementHelper.js +1 -1
  165. package/lib/hmr/LazyCompilationPlugin.js +6 -6
  166. package/lib/hmr/lazyCompilationBackend.js +6 -6
  167. package/lib/ids/ChunkModuleIdRangePlugin.js +4 -4
  168. package/lib/ids/DeterministicChunkIdsPlugin.js +5 -4
  169. package/lib/ids/DeterministicModuleIdsPlugin.js +2 -2
  170. package/lib/ids/HashedModuleIdsPlugin.js +1 -1
  171. package/lib/ids/IdHelpers.js +9 -9
  172. package/lib/ids/NamedChunkIdsPlugin.js +5 -5
  173. package/lib/ids/NamedModuleIdsPlugin.js +2 -2
  174. package/lib/ids/NaturalChunkIdsPlugin.js +2 -2
  175. package/lib/ids/NaturalModuleIdsPlugin.js +1 -1
  176. package/lib/ids/OccurrenceChunkIdsPlugin.js +2 -2
  177. package/lib/ids/OccurrenceModuleIdsPlugin.js +4 -4
  178. package/lib/ids/SyncModuleIdsPlugin.js +4 -4
  179. package/lib/index.js +18 -6
  180. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +1 -1
  181. package/lib/javascript/BasicEvaluatedExpression.js +3 -3
  182. package/lib/javascript/ChunkFormatHelpers.js +70 -0
  183. package/lib/javascript/CommonJsChunkFormatPlugin.js +10 -21
  184. package/lib/javascript/EnableChunkLoadingPlugin.js +1 -1
  185. package/lib/javascript/JavascriptGenerator.js +1 -1
  186. package/lib/javascript/JavascriptModulesPlugin.js +108 -54
  187. package/lib/javascript/JavascriptParser.js +80 -78
  188. package/lib/javascript/JavascriptParserHelpers.js +3 -3
  189. package/lib/javascript/StartupHelpers.js +2 -2
  190. package/lib/json/JsonGenerator.js +2 -2
  191. package/lib/json/JsonModulesPlugin.js +2 -2
  192. package/lib/library/AbstractLibraryPlugin.js +30 -3
  193. package/lib/library/AmdLibraryPlugin.js +3 -3
  194. package/lib/library/AssignLibraryPlugin.js +2 -2
  195. package/lib/library/EnableLibraryPlugin.js +2 -2
  196. package/lib/library/ModuleLibraryPlugin.js +49 -31
  197. package/lib/library/SystemLibraryPlugin.js +6 -4
  198. package/lib/library/UmdLibraryPlugin.js +14 -14
  199. package/lib/logging/createConsoleLogger.js +4 -4
  200. package/lib/logging/runtime.js +3 -3
  201. package/lib/logging/truncateArgs.js +4 -4
  202. package/lib/node/CommonJsChunkLoadingPlugin.js +2 -2
  203. package/lib/node/NodeEnvironmentPlugin.js +1 -1
  204. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +16 -14
  205. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +7 -7
  206. package/lib/node/ReadFileCompileWasmPlugin.js +7 -7
  207. package/lib/node/RequireChunkLoadingRuntimeModule.js +13 -6
  208. package/lib/node/nodeConsole.js +2 -2
  209. package/lib/optimize/AggressiveMergingPlugin.js +2 -2
  210. package/lib/optimize/AggressiveSplittingPlugin.js +10 -10
  211. package/lib/optimize/ConcatenatedModule.js +186 -77
  212. package/lib/optimize/EnsureChunkConditionsPlugin.js +2 -2
  213. package/lib/optimize/FlagIncludedChunksPlugin.js +2 -2
  214. package/lib/optimize/InnerGraph.js +5 -5
  215. package/lib/optimize/InnerGraphPlugin.js +14 -12
  216. package/lib/optimize/LimitChunkCountPlugin.js +5 -5
  217. package/lib/optimize/MangleExportsPlugin.js +5 -5
  218. package/lib/optimize/MergeDuplicateChunksPlugin.js +2 -2
  219. package/lib/optimize/MinChunkSizePlugin.js +3 -3
  220. package/lib/optimize/ModuleConcatenationPlugin.js +45 -38
  221. package/lib/optimize/RealContentHashPlugin.js +23 -23
  222. package/lib/optimize/RemoveEmptyChunksPlugin.js +2 -2
  223. package/lib/optimize/RemoveParentModulesPlugin.js +3 -3
  224. package/lib/optimize/RuntimeChunkPlugin.js +2 -2
  225. package/lib/optimize/SideEffectsFlagPlugin.js +5 -5
  226. package/lib/optimize/SplitChunksPlugin.js +20 -20
  227. package/lib/performance/AssetsOverSizeLimitWarning.js +1 -1
  228. package/lib/performance/EntrypointsOverSizeLimitWarning.js +2 -2
  229. package/lib/performance/SizeLimitsPlugin.js +4 -4
  230. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +1 -1
  231. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +3 -3
  232. package/lib/rules/BasicMatcherRulePlugin.js +1 -1
  233. package/lib/rules/RuleSetCompiler.js +10 -10
  234. package/lib/rules/UseEffectRulePlugin.js +2 -2
  235. package/lib/runtime/GetChunkFilenameRuntimeModule.js +19 -15
  236. package/lib/runtime/GetMainFilenameRuntimeModule.js +1 -1
  237. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +1 -1
  238. package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +1 -1
  239. package/lib/runtime/StartupChunkDependenciesPlugin.js +2 -2
  240. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +3 -3
  241. package/lib/schemes/DataUriPlugin.js +3 -3
  242. package/lib/schemes/FileUriPlugin.js +1 -1
  243. package/lib/schemes/HttpUriPlugin.js +40 -36
  244. package/lib/schemes/VirtualUrlPlugin.js +1 -1
  245. package/lib/serialization/BinaryMiddleware.js +11 -11
  246. package/lib/serialization/FileMiddleware.js +18 -17
  247. package/lib/serialization/ObjectMiddleware.js +8 -8
  248. package/lib/serialization/Serializer.js +2 -2
  249. package/lib/serialization/SerializerMiddleware.js +2 -2
  250. package/lib/sharing/ConsumeSharedPlugin.js +4 -4
  251. package/lib/sharing/ProvideSharedPlugin.js +4 -4
  252. package/lib/sharing/SharePlugin.js +1 -1
  253. package/lib/sharing/resolveMatchedConfigs.js +1 -1
  254. package/lib/stats/DefaultStatsFactoryPlugin.js +85 -80
  255. package/lib/stats/DefaultStatsPresetPlugin.js +15 -15
  256. package/lib/stats/DefaultStatsPrinterPlugin.js +87 -87
  257. package/lib/stats/StatsFactory.js +7 -7
  258. package/lib/stats/StatsPrinter.js +9 -9
  259. package/lib/url/URLParserPlugin.js +5 -5
  260. package/lib/util/AsyncQueue.js +4 -4
  261. package/lib/util/IterableHelpers.js +2 -2
  262. package/lib/util/LazyBucketSortedSet.js +3 -3
  263. package/lib/util/SetHelpers.js +2 -2
  264. package/lib/util/StackedCacheMap.js +1 -1
  265. package/lib/util/StackedMap.js +1 -1
  266. package/lib/util/TupleSet.js +1 -1
  267. package/lib/util/WeakTupleMap.js +1 -1
  268. package/lib/util/cleverMerge.js +8 -8
  269. package/lib/util/comparators.js +10 -10
  270. package/lib/util/compileBooleanMatcher.js +20 -20
  271. package/lib/util/concatenate.js +3 -3
  272. package/lib/util/conventions.js +4 -4
  273. package/lib/util/create-schema-validation.js +1 -1
  274. package/lib/util/createHash.js +1 -1
  275. package/lib/util/deprecation.js +4 -4
  276. package/lib/util/deterministicGrouping.js +7 -7
  277. package/lib/util/findGraphRoots.js +1 -1
  278. package/lib/util/fs.js +4 -4
  279. package/lib/util/identifier.js +14 -14
  280. package/lib/util/magicComment.js +5 -1
  281. package/lib/util/memoize.js +1 -1
  282. package/lib/util/processAsyncTree.js +2 -2
  283. package/lib/util/propertyName.js +1 -1
  284. package/lib/util/removeBOM.js +1 -1
  285. package/lib/util/runtime.js +6 -6
  286. package/lib/util/semver.js +16 -16
  287. package/lib/util/serialization.js +5 -5
  288. package/lib/util/smartGrouping.js +1 -1
  289. package/lib/validateSchema.js +2 -2
  290. package/lib/wasm/EnableWasmLoadingPlugin.js +1 -1
  291. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +1 -1
  292. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +1 -1
  293. package/lib/wasm-async/UniversalCompileAsyncWasmPlugin.js +4 -4
  294. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +13 -9
  295. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +2 -2
  296. package/lib/wasm-sync/WebAssemblyGenerator.js +16 -17
  297. package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +4 -2
  298. package/lib/wasm-sync/WebAssemblyParser.js +2 -2
  299. package/lib/web/FetchCompileAsyncWasmPlugin.js +4 -4
  300. package/lib/web/FetchCompileWasmPlugin.js +4 -4
  301. package/lib/web/JsonpChunkLoadingPlugin.js +2 -2
  302. package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -1
  303. package/lib/webpack.js +17 -12
  304. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +2 -2
  305. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
  306. package/package.json +16 -16
  307. package/schemas/WebpackOptions.check.js +1 -1
  308. package/schemas/WebpackOptions.json +4 -0
  309. package/types.d.ts +275 -64
@@ -24,7 +24,7 @@ class FileUriPlugin {
24
24
  (compilation, { normalModuleFactory }) => {
25
25
  normalModuleFactory.hooks.resolveForScheme
26
26
  .for("file")
27
- .tap(PLUGIN_NAME, resourceData => {
27
+ .tap(PLUGIN_NAME, (resourceData) => {
28
28
  const url = new URL(resourceData.resource);
29
29
  const path = fileURLToPath(url);
30
30
  const query = url.search;
@@ -46,7 +46,7 @@ const proxyFetch = (request, proxy) => (url, options, callback) => {
46
46
  * @param {Socket=} socket socket
47
47
  * @returns {void}
48
48
  */
49
- const doRequest = socket => {
49
+ const doRequest = (socket) => {
50
50
  request
51
51
  .get(url, { ...options, ...(socket && { socket }) }, callback)
52
52
  .on("error", eventEmitter.emit.bind(eventEmitter, "error"));
@@ -68,7 +68,7 @@ const proxyFetch = (request, proxy) => (url, options, callback) => {
68
68
  doRequest(socket);
69
69
  }
70
70
  })
71
- .on("error", err => {
71
+ .on("error", (err) => {
72
72
  eventEmitter.emit(
73
73
  "error",
74
74
  new Error(
@@ -101,7 +101,7 @@ const validate = createSchemaValidation(
101
101
  * @param {string} str path
102
102
  * @returns {string} safe path
103
103
  */
104
- const toSafePath = str =>
104
+ const toSafePath = (str) =>
105
105
  str
106
106
  .replace(/^[^a-zA-Z0-9]+|[^a-zA-Z0-9]+$/g, "")
107
107
  .replace(/[^a-zA-Z0-9._-]+/g, "_");
@@ -110,7 +110,7 @@ const toSafePath = str =>
110
110
  * @param {Buffer} content content
111
111
  * @returns {string} integrity
112
112
  */
113
- const computeIntegrity = content => {
113
+ const computeIntegrity = (content) => {
114
114
  const hash = createHash("sha512");
115
115
  hash.update(content);
116
116
  const integrity = `sha512-${hash.digest("base64")}`;
@@ -131,7 +131,7 @@ const verifyIntegrity = (content, integrity) => {
131
131
  * @param {string} str input
132
132
  * @returns {Record<string, string>} parsed
133
133
  */
134
- const parseKeyValuePairs = str => {
134
+ const parseKeyValuePairs = (str) => {
135
135
  /** @type {Record<string, string>} */
136
136
  const result = {};
137
137
  for (const item of str.split(",")) {
@@ -197,7 +197,7 @@ const areLockfileEntriesEqual = (a, b) =>
197
197
  * @param {LockfileEntry} entry lockfile entry
198
198
  * @returns {`resolved: ${string}, integrity: ${string}, contentType: ${string}`} stringified entry
199
199
  */
200
- const entryToString = entry =>
200
+ const entryToString = (entry) =>
201
201
  `resolved: ${entry.resolved}, integrity: ${entry.integrity}, contentType: ${entry.contentType}`;
202
202
 
203
203
  class Lockfile {
@@ -273,7 +273,7 @@ class Lockfile {
273
273
  * @param {FnWithoutKey<R>} fn function
274
274
  * @returns {FnWithoutKey<R>} cached function
275
275
  */
276
- const cachedWithoutKey = fn => {
276
+ const cachedWithoutKey = (fn) => {
277
277
  let inFlight = false;
278
278
  /** @type {Error | undefined} */
279
279
  let cachedError;
@@ -281,7 +281,7 @@ const cachedWithoutKey = fn => {
281
281
  let cachedResult;
282
282
  /** @type {FnWithoutKeyCallback<R>[] | undefined} */
283
283
  let cachedCallbacks;
284
- return callback => {
284
+ return (callback) => {
285
285
  if (inFlight) {
286
286
  if (cachedResult !== undefined) return callback(null, cachedResult);
287
287
  if (cachedError !== undefined) return callback(cachedError);
@@ -487,7 +487,7 @@ class HttpUriPlugin {
487
487
  * @param {string} url the url
488
488
  * @returns {string} the key
489
489
  */
490
- const getCacheKey = url => {
490
+ const getCacheKey = (url) => {
491
491
  const cachedResult = cacheKeyCache.get(url);
492
492
  if (cachedResult !== undefined) return cachedResult;
493
493
  const result = _getCacheKey(url);
@@ -499,7 +499,7 @@ class HttpUriPlugin {
499
499
  * @param {string} url the url
500
500
  * @returns {string} the key
501
501
  */
502
- const _getCacheKey = url => {
502
+ const _getCacheKey = (url) => {
503
503
  const parsedUrl = new URL(url);
504
504
  const folder = toSafePath(parsedUrl.origin);
505
505
  const name = toSafePath(parsedUrl.pathname);
@@ -520,7 +520,7 @@ class HttpUriPlugin {
520
520
  * @param {(err: Error | null, lockfile?: Lockfile) => void} callback callback
521
521
  * @returns {void}
522
522
  */
523
- callback => {
523
+ (callback) => {
524
524
  const readLockfile = () => {
525
525
  intermediateFs.readFile(lockfileLocation, (err, buffer) => {
526
526
  if (err && err.code !== "ENOENT") {
@@ -622,9 +622,9 @@ class HttpUriPlugin {
622
622
  }
623
623
  const key = getCacheKey(result.entry.resolved);
624
624
  const filePath = join(intermediateFs, cacheLocation, key);
625
- mkdirp(intermediateFs, dirname(intermediateFs, filePath), err => {
625
+ mkdirp(intermediateFs, dirname(intermediateFs, filePath), (err) => {
626
626
  if (err) return callback(err);
627
- intermediateFs.writeFile(filePath, result.content, err => {
627
+ intermediateFs.writeFile(filePath, result.content, (err) => {
628
628
  if (err) return callback(err);
629
629
  callback(null, result);
630
630
  });
@@ -706,7 +706,7 @@ class HttpUriPlugin {
706
706
  headers["if-none-match"] = cachedResult.etag;
707
707
  }
708
708
 
709
- fetch(new URL(url), { headers }, res => {
709
+ fetch(new URL(url), { headers }, (res) => {
710
710
  const etag = res.headers.etag;
711
711
  const location = res.headers.location;
712
712
  const cacheControl = res.headers["cache-control"];
@@ -718,7 +718,7 @@ class HttpUriPlugin {
718
718
  * @param {Partial<Pick<FetchResultMeta, "fresh">> & (Pick<RedirectFetchResult, "location"> | Pick<ContentFetchResult, "content" | "entry">)} partialResult result
719
719
  * @returns {void}
720
720
  */
721
- const finishWith = partialResult => {
721
+ const finishWith = (partialResult) => {
722
722
  if ("location" in partialResult) {
723
723
  logger.debug(
724
724
  `GET ${url} [${res.statusCode}] -> ${partialResult.location}`
@@ -751,7 +751,7 @@ class HttpUriPlugin {
751
751
  ...result,
752
752
  fresh: false
753
753
  },
754
- err => {
754
+ (err) => {
755
755
  if (err) {
756
756
  logger.warn(
757
757
  `${url} can't be stored in cache: ${err.message}`
@@ -820,7 +820,7 @@ class HttpUriPlugin {
820
820
  stream = stream.pipe(createInflate());
821
821
  }
822
822
 
823
- stream.on("data", chunk => {
823
+ stream.on("data", (chunk) => {
824
824
  bufferArr.push(chunk);
825
825
  });
826
826
 
@@ -851,7 +851,7 @@ class HttpUriPlugin {
851
851
  content
852
852
  });
853
853
  });
854
- }).on("error", err => {
854
+ }).on("error", (err) => {
855
855
  logger.log(`GET ${url} (error)`);
856
856
  err.message += `\nwhile fetching ${url}`;
857
857
  callback(err);
@@ -881,7 +881,7 @@ class HttpUriPlugin {
881
881
  * @param {string} uri uri
882
882
  * @returns {boolean} true when allowed, otherwise false
883
883
  */
884
- const isAllowed = uri => {
884
+ const isAllowed = (uri) => {
885
885
  for (const allowed of allowedUris) {
886
886
  if (typeof allowed === "string") {
887
887
  if (uri.startsWith(allowed)) return true;
@@ -908,7 +908,7 @@ class HttpUriPlugin {
908
908
  return callback(
909
909
  new Error(
910
910
  `${url} doesn't match the allowedUris policy. These URIs are allowed:\n${allowedUris
911
- .map(uri => ` - ${uri}`)
911
+ .map((uri) => ` - ${uri}`)
912
912
  .join("\n")}`
913
913
  )
914
914
  );
@@ -972,7 +972,7 @@ Remove this line from the lockfile to force upgrading.`
972
972
  /**
973
973
  * @param {Buffer=} lockedContent locked content
974
974
  */
975
- const doFetch = lockedContent => {
975
+ const doFetch = (lockedContent) => {
976
976
  resolveContent(url, entry.integrity, (err, _result) => {
977
977
  if (err) {
978
978
  if (lockedContent) {
@@ -1053,7 +1053,7 @@ Remove this line from the lockfile to force upgrading.`
1053
1053
  * @param {Buffer | undefined} _result result
1054
1054
  * @returns {void}
1055
1055
  */
1056
- const continueWithCachedContent = _result => {
1056
+ const continueWithCachedContent = (_result) => {
1057
1057
  if (!upgrade) {
1058
1058
  // When not in upgrade mode, we accept the result from the lockfile cache
1059
1059
  return callback(null, { entry, content });
@@ -1101,7 +1101,7 @@ This will avoid that the end of line sequence is changed by git on Windows.`;
1101
1101
  filePath,
1102
1102
  /** @type {Buffer} */
1103
1103
  (contentWithChangedEol),
1104
- err => {
1104
+ (err) => {
1105
1105
  if (err) return callback(err);
1106
1106
  continueWithCachedContent(
1107
1107
  /** @type {Buffer} */
@@ -1260,15 +1260,10 @@ Run build with un-frozen lockfile to automatically fix lockfile.`
1260
1260
  )) {
1261
1261
  lockfile.entries.set(key, value);
1262
1262
  }
1263
- intermediateFs.writeFile(tempFile, lockfile.toString(), err => {
1264
- if (err) {
1265
- writeDone();
1266
- return (
1267
- /** @type {NonNullable<IntermediateFileSystem["unlink"]>} */
1268
- (intermediateFs.unlink)(tempFile, () => callback(err))
1269
- );
1270
- }
1271
- intermediateFs.rename(tempFile, lockfileLocation, err => {
1263
+ intermediateFs.writeFile(
1264
+ tempFile,
1265
+ lockfile.toString(),
1266
+ (err) => {
1272
1267
  if (err) {
1273
1268
  writeDone();
1274
1269
  return (
@@ -1276,10 +1271,19 @@ Run build with un-frozen lockfile to automatically fix lockfile.`
1276
1271
  (intermediateFs.unlink)(tempFile, () => callback(err))
1277
1272
  );
1278
1273
  }
1279
- writeDone();
1280
- callback();
1281
- });
1282
- });
1274
+ intermediateFs.rename(tempFile, lockfileLocation, (err) => {
1275
+ if (err) {
1276
+ writeDone();
1277
+ return (
1278
+ /** @type {NonNullable<IntermediateFileSystem["unlink"]>} */
1279
+ (intermediateFs.unlink)(tempFile, () => callback(err))
1280
+ );
1281
+ }
1282
+ writeDone();
1283
+ callback();
1284
+ });
1285
+ }
1286
+ );
1283
1287
  });
1284
1288
  };
1285
1289
  if (inProgressWrite) {
@@ -124,7 +124,7 @@ class VirtualUrlPlugin {
124
124
  (compilation, { normalModuleFactory }) => {
125
125
  normalModuleFactory.hooks.resolveForScheme
126
126
  .for(scheme)
127
- .tap(PLUGIN_NAME, resourceData => {
127
+ .tap(PLUGIN_NAME, (resourceData) => {
128
128
  const virtualConfig = this.findVirtualModuleConfigById(
129
129
  resourceData.resource
130
130
  );
@@ -117,7 +117,7 @@ const MEASURE_END_OPERATION = Symbol("MEASURE_END_OPERATION");
117
117
  * @param {number} n number
118
118
  * @returns {0 | 1 | 2} type of number for serialization
119
119
  */
120
- const identifyNumber = n => {
120
+ const identifyNumber = (n) => {
121
121
  if (n === (n | 0)) {
122
122
  if (n <= 127 && n >= -128) return 0;
123
123
  if (n <= 2147483647 && n >= -2147483648) return 1;
@@ -129,7 +129,7 @@ const identifyNumber = n => {
129
129
  * @param {bigint} n bigint
130
130
  * @returns {0 | 1 | 2} type of bigint for serialization
131
131
  */
132
- const identifyBigInt = n => {
132
+ const identifyBigInt = (n) => {
133
133
  if (n <= BigInt(127) && n >= BigInt(-128)) return 0;
134
134
  if (n <= BigInt(2147483647) && n >= BigInt(-2147483648)) return 1;
135
135
  return 2;
@@ -164,7 +164,7 @@ class BinaryMiddleware extends SerializerMiddleware {
164
164
  * @returns {LazyFunction<SerializedType, DeserializedType>} new lazy
165
165
  */
166
166
  _serializeLazy(fn, context) {
167
- return SerializerMiddleware.serializeLazy(fn, data =>
167
+ return SerializerMiddleware.serializeLazy(fn, (data) =>
168
168
  this._serialize(data, context)
169
169
  );
170
170
  }
@@ -198,7 +198,7 @@ class BinaryMiddleware extends SerializerMiddleware {
198
198
  /**
199
199
  * @param {number} bytesNeeded bytes needed
200
200
  */
201
- const allocate = bytesNeeded => {
201
+ const allocate = (bytesNeeded) => {
202
202
  if (currentBuffer !== null) {
203
203
  if (currentBuffer.length - currentPosition >= bytesNeeded) return;
204
204
  flush();
@@ -248,14 +248,14 @@ class BinaryMiddleware extends SerializerMiddleware {
248
248
  /**
249
249
  * @param {number} byte byte
250
250
  */
251
- const writeU8 = byte => {
251
+ const writeU8 = (byte) => {
252
252
  /** @type {Buffer} */
253
253
  (currentBuffer).writeUInt8(byte, currentPosition++);
254
254
  };
255
255
  /**
256
256
  * @param {number} ui32 ui32
257
257
  */
258
- const writeU32 = ui32 => {
258
+ const writeU32 = (ui32) => {
259
259
  /** @type {Buffer} */
260
260
  (currentBuffer).writeUInt32LE(ui32, currentPosition);
261
261
  currentPosition += 4;
@@ -679,7 +679,7 @@ class BinaryMiddleware extends SerializerMiddleware {
679
679
  * @returns {LazyFunction<DeserializedType, SerializedType>} new lazy
680
680
  */
681
681
  _deserializeLazy(fn, context) {
682
- return SerializerMiddleware.deserializeLazy(fn, data =>
682
+ return SerializerMiddleware.deserializeLazy(fn, (data) =>
683
683
  this._deserialize(data, context)
684
684
  );
685
685
  }
@@ -696,7 +696,7 @@ class BinaryMiddleware extends SerializerMiddleware {
696
696
  let currentIsBuffer = Buffer.isBuffer(currentBuffer);
697
697
  let currentPosition = 0;
698
698
 
699
- const retainedBuffer = context.retainedBuffer || (x => x);
699
+ const retainedBuffer = context.retainedBuffer || ((x) => x);
700
700
 
701
701
  const checkOverflow = () => {
702
702
  if (currentPosition >= /** @type {Buffer} */ (currentBuffer).length) {
@@ -711,7 +711,7 @@ class BinaryMiddleware extends SerializerMiddleware {
711
711
  * @param {number} n n
712
712
  * @returns {boolean} true when in current buffer, otherwise false
713
713
  */
714
- const isInCurrentBuffer = n =>
714
+ const isInCurrentBuffer = (n) =>
715
715
  currentIsBuffer &&
716
716
  n + currentPosition <= /** @type {Buffer} */ (currentBuffer).length;
717
717
  const ensureBuffer = () => {
@@ -728,7 +728,7 @@ class BinaryMiddleware extends SerializerMiddleware {
728
728
  * @param {number} n amount of bytes to read
729
729
  * @returns {Buffer} buffer with bytes
730
730
  */
731
- const read = n => {
731
+ const read = (n) => {
732
732
  ensureBuffer();
733
733
  const rem =
734
734
  /** @type {Buffer} */ (currentBuffer).length - currentPosition;
@@ -760,7 +760,7 @@ class BinaryMiddleware extends SerializerMiddleware {
760
760
  * @param {number} n amount of bytes to read
761
761
  * @returns {Buffer} buffer with bytes
762
762
  */
763
- const readUpTo = n => {
763
+ const readUpTo = (n) => {
764
764
  ensureBuffer();
765
765
  const rem =
766
766
  /** @type {Buffer} */
@@ -149,7 +149,7 @@ const serialize = async (
149
149
  (options && options.name) || true,
150
150
  writeFile,
151
151
  hashFunction
152
- ).then(result => {
152
+ ).then((result) => {
153
153
  /** @type {LazyOptions} */
154
154
  (item.options).size = result.size;
155
155
  resultToLazy.set(result, item);
@@ -175,7 +175,7 @@ const serialize = async (
175
175
  }
176
176
  /** @type {BackgroundJob[]} */
177
177
  const backgroundJobs = [];
178
- const resolvedData = (await Promise.all(processedData)).map(item => {
178
+ const resolvedData = (await Promise.all(processedData)).map((item) => {
179
179
  if (Array.isArray(item) || Buffer.isBuffer(item)) return item;
180
180
 
181
181
  backgroundJobs.push(
@@ -265,13 +265,14 @@ const deserialize = async (middleware, name, readFile) => {
265
265
  /**
266
266
  * @param {number} n number of bytes to ensure
267
267
  */
268
- const ensureData = n => {
268
+ const ensureData = (n) => {
269
269
  if (contentPosition === contentItemLength) {
270
270
  nextContent();
271
271
  }
272
272
  while (contentItemLength - contentPosition < n) {
273
273
  const remaining = contentItem.slice(contentPosition);
274
274
  let lengthFromNext = n - remaining.length;
275
+ /** @type {Buffer[]} */
275
276
  const buffers = [remaining];
276
277
  for (let i = contentsIndex + 1; i < contents.length; i++) {
277
278
  const l = contents[i].length;
@@ -314,7 +315,7 @@ const deserialize = async (middleware, name, readFile) => {
314
315
  * @param {number} l length
315
316
  * @returns {Buffer} buffer
316
317
  */
317
- const readSlice = l => {
318
+ const readSlice = (l) => {
318
319
  ensureData(l);
319
320
  if (contentPosition === 0 && contentItemLength === l) {
320
321
  const result = contentItem;
@@ -448,7 +449,7 @@ class FileMiddleware extends SerializerMiddleware {
448
449
  serialize(data, context) {
449
450
  const { filename, extension = "" } = context;
450
451
  return new Promise((resolve, reject) => {
451
- mkdirp(this.fs, dirname(this.fs, filename), err => {
452
+ mkdirp(this.fs, dirname(this.fs, filename), (err) => {
452
453
  if (err) return reject(err);
453
454
 
454
455
  // It's important that we don't touch existing files during serialization
@@ -493,7 +494,7 @@ class FileMiddleware extends SerializerMiddleware {
493
494
  stream = compression;
494
495
  stream.on("finish", () => resolve());
495
496
  } else {
496
- stream.on("error", err => reject(err));
497
+ stream.on("error", (err) => reject(err));
497
498
  stream.on("finish", () => resolve());
498
499
  }
499
500
  // split into chunks for WRITE_LIMIT_CHUNK size
@@ -514,7 +515,7 @@ class FileMiddleware extends SerializerMiddleware {
514
515
  /**
515
516
  * @param {(Error | null)=} err err
516
517
  */
517
- const batchWrite = err => {
518
+ const batchWrite = (err) => {
518
519
  // will be handled in "on" error handler
519
520
  if (err) return;
520
521
 
@@ -553,8 +554,8 @@ class FileMiddleware extends SerializerMiddleware {
553
554
  /**
554
555
  * @param {(value?: undefined) => void} resolve resolve
555
556
  */
556
- resolve => {
557
- this.fs.rename(filename, `${filename}.old`, _err => {
557
+ (resolve) => {
558
+ this.fs.rename(filename, `${filename}.old`, (_err) => {
558
559
  resolve();
559
560
  });
560
561
  }
@@ -564,7 +565,7 @@ class FileMiddleware extends SerializerMiddleware {
564
565
  await Promise.all(
565
566
  Array.from(
566
567
  allWrittenFiles,
567
- file =>
568
+ (file) =>
568
569
  new Promise(
569
570
  /**
570
571
  * @param {(value?: undefined) => void} resolve resolve
@@ -572,7 +573,7 @@ class FileMiddleware extends SerializerMiddleware {
572
573
  * @returns {void}
573
574
  */
574
575
  (resolve, reject) => {
575
- this.fs.rename(`${file}_`, file, err => {
576
+ this.fs.rename(`${file}_`, file, (err) => {
576
577
  if (err) return reject(err);
577
578
  resolve();
578
579
  });
@@ -587,8 +588,8 @@ class FileMiddleware extends SerializerMiddleware {
587
588
  * @param {(value?: undefined) => void} resolve resolve
588
589
  * @returns {void}
589
590
  */
590
- resolve => {
591
- this.fs.rename(`${filename}_`, filename, err => {
591
+ (resolve) => {
592
+ this.fs.rename(`${filename}_`, filename, (err) => {
592
593
  if (err) return reject(err);
593
594
  resolve();
594
595
  });
@@ -613,7 +614,7 @@ class FileMiddleware extends SerializerMiddleware {
613
614
  * @param {string | boolean} name name
614
615
  * @returns {Promise<Buffer[]>} result
615
616
  */
616
- const readFile = name =>
617
+ const readFile = (name) =>
617
618
  new Promise((resolve, reject) => {
618
619
  const file = name
619
620
  ? join(this.fs, filename, `../${name}${extension}`)
@@ -661,9 +662,9 @@ class FileMiddleware extends SerializerMiddleware {
661
662
  * @param {(reason?: Error) => void} reject reject
662
663
  */
663
664
  (resolve, reject) => {
664
- decompression.on("data", chunk => buf.push(chunk));
665
+ decompression.on("data", (chunk) => buf.push(chunk));
665
666
  decompression.on("end", () => resolve());
666
- decompression.on("error", err => reject(err));
667
+ decompression.on("error", (err) => reject(err));
667
668
  }
668
669
  )
669
670
  ]).then(() => buf)
@@ -735,7 +736,7 @@ class FileMiddleware extends SerializerMiddleware {
735
736
  if (decompression) {
736
737
  decompression.end();
737
738
  }
738
- this.fs.close(fd, err => {
739
+ this.fs.close(fd, (err) => {
739
740
  if (err) {
740
741
  reject(err);
741
742
  return;
@@ -343,7 +343,7 @@ class ObjectMiddleware extends SerializerMiddleware {
343
343
  /**
344
344
  * @param {ReferenceableItem} item referenceable item
345
345
  */
346
- const addReferenceable = item => {
346
+ const addReferenceable = (item) => {
347
347
  referenceable.set(item, currentPos++);
348
348
  };
349
349
  let bufferDedupeMap = new Map();
@@ -351,7 +351,7 @@ class ObjectMiddleware extends SerializerMiddleware {
351
351
  * @param {Buffer} buf buffer
352
352
  * @returns {Buffer} deduped buffer
353
353
  */
354
- const dedupeBuffer = buf => {
354
+ const dedupeBuffer = (buf) => {
355
355
  const len = buf.length;
356
356
  const entry = bufferDedupeMap.get(len);
357
357
  if (entry === undefined) {
@@ -415,11 +415,11 @@ class ObjectMiddleware extends SerializerMiddleware {
415
415
  * @param {Value} item item to stack
416
416
  * @returns {string} stack
417
417
  */
418
- const stackToString = item => {
418
+ const stackToString = (item) => {
419
419
  const arr = [...cycleStack];
420
420
  arr.push(item);
421
421
  return arr
422
- .map(item => {
422
+ .map((item) => {
423
423
  if (typeof item === "string") {
424
424
  if (item.length > 100) {
425
425
  return `String ${JSON.stringify(item.slice(0, 100)).slice(
@@ -513,7 +513,7 @@ class ObjectMiddleware extends SerializerMiddleware {
513
513
  /**
514
514
  * @param {Value} item item to serialize
515
515
  */
516
- const process = item => {
516
+ const process = (item) => {
517
517
  if (Buffer.isBuffer(item)) {
518
518
  // check if we can emit a reference
519
519
  const ref = referenceable.get(item);
@@ -616,7 +616,7 @@ class ObjectMiddleware extends SerializerMiddleware {
616
616
  } else if (SerializerMiddleware.isLazy(item, this)) {
617
617
  throw new Error("Not implemented");
618
618
  } else {
619
- const data = SerializerMiddleware.serializeLazy(item, data =>
619
+ const data = SerializerMiddleware.serializeLazy(item, (data) =>
620
620
  this.serialize([data], context)
621
621
  );
622
622
  SerializerMiddleware.setLazySerializedValue(item, data);
@@ -679,7 +679,7 @@ class ObjectMiddleware extends SerializerMiddleware {
679
679
  /**
680
680
  * @param {Value} item referenceable item
681
681
  */
682
- const addReferenceable = item => {
682
+ const addReferenceable = (item) => {
683
683
  referenceable.push(item);
684
684
  currentPos++;
685
685
  };
@@ -811,7 +811,7 @@ class ObjectMiddleware extends SerializerMiddleware {
811
811
  } else if (typeof item === "function") {
812
812
  return SerializerMiddleware.deserializeLazy(
813
813
  item,
814
- data =>
814
+ (data) =>
815
815
  /** @type {[DeserializedType]} */
816
816
  (this.deserialize(data, context))[0]
817
817
  );
@@ -42,7 +42,7 @@ class Serializer {
42
42
  ) {
43
43
  current =
44
44
  /** @type {Promise<DeserializedValue>} */
45
- (current).then(data => data && middleware.serialize(data, ctx));
45
+ (current).then((data) => data && middleware.serialize(data, ctx));
46
46
  } else if (current) {
47
47
  try {
48
48
  current = middleware.serialize(current, ctx);
@@ -70,7 +70,7 @@ class Serializer {
70
70
  current &&
71
71
  typeof (/** @type {Promise<SerializedValue>} */ (current).then) ===
72
72
  "function"
73
- ? /** @type {Promise<SerializedValue>} */ (current).then(data =>
73
+ ? /** @type {Promise<SerializedValue>} */ (current).then((data) =>
74
74
  middleware.deserialize(data, ctx)
75
75
  )
76
76
  : middleware.deserialize(current, ctx);
@@ -153,7 +153,7 @@ class SerializerMiddleware {
153
153
  ) {
154
154
  return (
155
155
  /** @type {Promise<TLazyInputValue>} */
156
- (r).then(data => data && serialize(data))
156
+ (r).then((data) => data && serialize(data))
157
157
  );
158
158
  }
159
159
  return serialize(/** @type {TLazyInputValue} */ (r));
@@ -187,7 +187,7 @@ class SerializerMiddleware {
187
187
  ) {
188
188
  return (
189
189
  /** @type {Promise<TLazyInputValue>} */
190
- (r).then(data => deserialize(data))
190
+ (r).then((data) => deserialize(data))
191
191
  );
192
192
  }
193
193
  return deserialize(/** @type {TLazyInputValue} */ (r));
@@ -148,7 +148,7 @@ class ConsumeSharedPlugin {
148
148
  /**
149
149
  * @param {string} details details
150
150
  */
151
- const requiredVersionWarning = details => {
151
+ const requiredVersionWarning = (details) => {
152
152
  const error = new WebpackError(
153
153
  `No required version specified and unable to automatically determine one. ${details}`
154
154
  );
@@ -163,7 +163,7 @@ class ConsumeSharedPlugin {
163
163
  /**
164
164
  * @param {(value?: string) => void} resolve resolve
165
165
  */
166
- resolve => {
166
+ (resolve) => {
167
167
  if (!config.import) {
168
168
  resolve();
169
169
  return;
@@ -208,7 +208,7 @@ class ConsumeSharedPlugin {
208
208
  /**
209
209
  * @param {(value?: SemVerRange) => void} resolve resolve
210
210
  */
211
- resolve => {
211
+ (resolve) => {
212
212
  if (config.requiredVersion !== undefined) {
213
213
  resolve(/** @type {SemVerRange} */ (config.requiredVersion));
214
214
  return;
@@ -276,7 +276,7 @@ class ConsumeSharedPlugin {
276
276
 
277
277
  resolve();
278
278
  },
279
- result => {
279
+ (result) => {
280
280
  if (!result) return false;
281
281
  const maybeRequiredVersion =
282
282
  getRequiredVersionFromDescriptionFile(
@@ -48,7 +48,7 @@ class ProvideSharedPlugin {
48
48
  this._provides = /** @type {[string, ProvideOptions][]} */ (
49
49
  parseOptions(
50
50
  options.provides,
51
- item => {
51
+ (item) => {
52
52
  if (Array.isArray(item)) {
53
53
  throw new Error("Unexpected array of provides");
54
54
  }
@@ -61,7 +61,7 @@ class ProvideSharedPlugin {
61
61
  };
62
62
  return result;
63
63
  },
64
- item => ({
64
+ (item) => ({
65
65
  shareKey: item.shareKey,
66
66
  version: item.version,
67
67
  shareScope: item.shareScope || options.shareScope || "default",
@@ -199,7 +199,7 @@ class ProvideSharedPlugin {
199
199
  );
200
200
  }
201
201
  );
202
- compiler.hooks.finishMake.tapPromise(PLUGIN_NAME, compilation => {
202
+ compiler.hooks.finishMake.tapPromise(PLUGIN_NAME, (compilation) => {
203
203
  const resolvedProvideMap = compilationData.get(compilation);
204
204
  if (!resolvedProvideMap) return Promise.resolve();
205
205
  return Promise.all(
@@ -219,7 +219,7 @@ class ProvideSharedPlugin {
219
219
  {
220
220
  name: undefined
221
221
  },
222
- err => {
222
+ (err) => {
223
223
  if (err) return reject(err);
224
224
  resolve(null);
225
225
  }
@@ -42,7 +42,7 @@ class SharePlugin {
42
42
  };
43
43
  return config;
44
44
  },
45
- item => item
45
+ (item) => item
46
46
  );
47
47
  /** @type {Record<string, ConsumesConfig>[]} */
48
48
  const consumes = sharedOptions.map(([key, options]) => ({