webpack 5.100.1 → 5.101.0

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 (304) 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 +21 -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 +127 -114
  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/DllEntryPlugin.js +1 -1
  26. package/lib/DllReferencePlugin.js +1 -1
  27. package/lib/DynamicEntryPlugin.js +3 -3
  28. package/lib/EntryPlugin.js +1 -1
  29. package/lib/EnvironmentPlugin.js +1 -1
  30. package/lib/ErrorHelpers.js +2 -2
  31. package/lib/EvalDevToolModulePlugin.js +2 -2
  32. package/lib/EvalSourceMapDevToolPlugin.js +5 -5
  33. package/lib/ExportsInfo.js +9 -9
  34. package/lib/ExportsInfoApiPlugin.js +2 -2
  35. package/lib/ExternalModule.js +163 -48
  36. package/lib/ExternalModuleFactoryPlugin.js +2 -2
  37. package/lib/ExternalsPlugin.js +45 -0
  38. package/lib/FileSystemInfo.js +64 -61
  39. package/lib/FlagAllModulesAsUsedPlugin.js +2 -2
  40. package/lib/FlagDependencyExportsPlugin.js +7 -7
  41. package/lib/FlagDependencyUsagePlugin.js +4 -4
  42. package/lib/FlagEntryExportAsUsedPlugin.js +1 -1
  43. package/lib/HotModuleReplacementPlugin.js +27 -27
  44. package/lib/IgnorePlugin.js +3 -3
  45. package/lib/IgnoreWarningsPlugin.js +4 -4
  46. package/lib/InitFragment.js +6 -0
  47. package/lib/InvalidDependenciesModuleWarning.js +1 -1
  48. package/lib/JavascriptMetaInfoPlugin.js +1 -1
  49. package/lib/LibManifestPlugin.js +2 -2
  50. package/lib/LoaderOptionsPlugin.js +1 -1
  51. package/lib/LoaderTargetPlugin.js +2 -2
  52. package/lib/MainTemplate.js +1 -1
  53. package/lib/Module.js +1 -1
  54. package/lib/ModuleFilenameHelpers.js +3 -3
  55. package/lib/ModuleGraph.js +86 -5
  56. package/lib/ModuleInfoHeaderPlugin.js +3 -3
  57. package/lib/ModuleParseError.js +5 -3
  58. package/lib/MultiCompiler.js +29 -24
  59. package/lib/MultiStats.js +18 -13
  60. package/lib/MultiWatching.js +1 -1
  61. package/lib/NoEmitOnErrorsPlugin.js +2 -2
  62. package/lib/NodeStuffPlugin.js +27 -15
  63. package/lib/NormalModule.js +28 -24
  64. package/lib/NormalModuleFactory.js +23 -21
  65. package/lib/NormalModuleReplacementPlugin.js +3 -3
  66. package/lib/PrefetchPlugin.js +1 -1
  67. package/lib/ProgressPlugin.js +11 -11
  68. package/lib/ProvidePlugin.js +2 -2
  69. package/lib/RecordIdsPlugin.js +3 -3
  70. package/lib/ResolverFactory.js +3 -3
  71. package/lib/RuntimeGlobals.js +20 -0
  72. package/lib/RuntimePlugin.js +16 -16
  73. package/lib/RuntimeTemplate.js +42 -44
  74. package/lib/SizeFormatHelpers.js +1 -1
  75. package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -4
  76. package/lib/SourceMapDevToolPlugin.js +9 -9
  77. package/lib/Stats.js +2 -2
  78. package/lib/Template.js +1 -1
  79. package/lib/TemplatedPathPlugin.js +2 -2
  80. package/lib/UseStrictPlugin.js +1 -1
  81. package/lib/WarnCaseSensitiveModulesPlugin.js +1 -1
  82. package/lib/WarnDeprecatedOptionPlugin.js +1 -1
  83. package/lib/WarnNoModeSetPlugin.js +1 -1
  84. package/lib/WatchIgnorePlugin.js +2 -2
  85. package/lib/Watching.js +12 -12
  86. package/lib/WebpackIsIncludedPlugin.js +2 -2
  87. package/lib/WebpackOptionsApply.js +10 -3
  88. package/lib/asset/AssetGenerator.js +3 -3
  89. package/lib/asset/AssetModulesPlugin.js +6 -6
  90. package/lib/async-modules/AsyncModuleHelpers.js +50 -0
  91. package/lib/async-modules/AwaitDependenciesInitFragment.js +36 -24
  92. package/lib/async-modules/InferAsyncModulesPlugin.js +3 -3
  93. package/lib/buildChunkGraph.js +5 -5
  94. package/lib/cache/AddBuildDependenciesPlugin.js +1 -1
  95. package/lib/cache/IdleFileCachePlugin.js +5 -5
  96. package/lib/cache/PackFileCacheStrategy.js +20 -20
  97. package/lib/cache/ResolverCachePlugin.js +4 -4
  98. package/lib/cli.js +196 -14
  99. package/lib/config/browserslistTargetHandler.js +6 -6
  100. package/lib/config/defaults.js +23 -14
  101. package/lib/config/normalization.js +41 -38
  102. package/lib/config/target.js +4 -4
  103. package/lib/container/ContainerEntryModule.js +3 -3
  104. package/lib/container/ContainerPlugin.js +3 -3
  105. package/lib/container/ContainerReferencePlugin.js +3 -3
  106. package/lib/container/FallbackModule.js +1 -1
  107. package/lib/container/HoistContainerReferencesPlugin.js +7 -7
  108. package/lib/container/options.js +4 -4
  109. package/lib/css/CssGenerator.js +5 -3
  110. package/lib/css/CssLoadingRuntimeModule.js +1 -1
  111. package/lib/css/CssModulesPlugin.js +25 -22
  112. package/lib/css/CssParser.js +5 -5
  113. package/lib/css/walkCssTokens.js +9 -9
  114. package/lib/debug/ProfilingPlugin.js +5 -5
  115. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +4 -4
  116. package/lib/dependencies/AMDPlugin.js +3 -3
  117. package/lib/dependencies/AMDRequireArrayDependency.js +1 -1
  118. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +3 -3
  119. package/lib/dependencies/CommonJsExportRequireDependency.js +2 -2
  120. package/lib/dependencies/CommonJsExportsParserPlugin.js +12 -10
  121. package/lib/dependencies/CommonJsImportsParserPlugin.js +21 -19
  122. package/lib/dependencies/CommonJsPlugin.js +2 -2
  123. package/lib/dependencies/ContextDependency.js +1 -1
  124. package/lib/dependencies/ContextDependencyHelpers.js +3 -3
  125. package/lib/dependencies/CssIcssExportDependency.js +2 -2
  126. package/lib/dependencies/CssLocalIdentifierDependency.js +2 -2
  127. package/lib/dependencies/CssUrlDependency.js +4 -4
  128. package/lib/dependencies/DynamicExports.js +5 -5
  129. package/lib/dependencies/HarmonyAcceptDependency.js +39 -5
  130. package/lib/dependencies/HarmonyDetectionParserPlugin.js +2 -2
  131. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +17 -23
  132. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +7 -8
  133. package/lib/dependencies/HarmonyExportInitFragment.js +1 -1
  134. package/lib/dependencies/HarmonyExports.js +1 -1
  135. package/lib/dependencies/HarmonyImportDependency.js +28 -9
  136. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +59 -75
  137. package/lib/dependencies/HarmonyImportSideEffectDependency.js +4 -5
  138. package/lib/dependencies/HarmonyImportSpecifierDependency.js +3 -4
  139. package/lib/dependencies/HarmonyModulesPlugin.js +2 -8
  140. package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +1 -1
  141. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +4 -4
  142. package/lib/dependencies/ImportMetaPlugin.js +7 -7
  143. package/lib/dependencies/ImportParserPlugin.js +4 -4
  144. package/lib/dependencies/JsonExportsDependency.js +1 -1
  145. package/lib/dependencies/LoaderPlugin.js +4 -4
  146. package/lib/dependencies/ProvidedDependency.js +2 -2
  147. package/lib/dependencies/PureExpressionDependency.js +1 -1
  148. package/lib/dependencies/RequireContextDependencyParserPlugin.js +1 -1
  149. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +1 -1
  150. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +3 -3
  151. package/lib/dependencies/SystemPlugin.js +3 -3
  152. package/lib/dependencies/WorkerPlugin.js +5 -5
  153. package/lib/dependencies/getFunctionExpression.js +1 -1
  154. package/lib/esm/ModuleChunkFormatPlugin.js +5 -5
  155. package/lib/esm/ModuleChunkLoadingPlugin.js +2 -2
  156. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +15 -11
  157. package/lib/formatLocation.js +2 -2
  158. package/lib/hmr/HotModuleReplacement.runtime.js +39 -27
  159. package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +43 -32
  160. package/lib/hmr/JavascriptHotModuleReplacementHelper.js +1 -1
  161. package/lib/hmr/LazyCompilationPlugin.js +6 -6
  162. package/lib/hmr/lazyCompilationBackend.js +6 -6
  163. package/lib/ids/ChunkModuleIdRangePlugin.js +4 -4
  164. package/lib/ids/DeterministicChunkIdsPlugin.js +5 -4
  165. package/lib/ids/DeterministicModuleIdsPlugin.js +2 -2
  166. package/lib/ids/HashedModuleIdsPlugin.js +1 -1
  167. package/lib/ids/IdHelpers.js +9 -9
  168. package/lib/ids/NamedChunkIdsPlugin.js +5 -5
  169. package/lib/ids/NamedModuleIdsPlugin.js +2 -2
  170. package/lib/ids/NaturalChunkIdsPlugin.js +2 -2
  171. package/lib/ids/NaturalModuleIdsPlugin.js +1 -1
  172. package/lib/ids/OccurrenceChunkIdsPlugin.js +2 -2
  173. package/lib/ids/OccurrenceModuleIdsPlugin.js +4 -4
  174. package/lib/ids/SyncModuleIdsPlugin.js +4 -4
  175. package/lib/index.js +10 -6
  176. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +1 -1
  177. package/lib/javascript/BasicEvaluatedExpression.js +3 -3
  178. package/lib/javascript/CommonJsChunkFormatPlugin.js +1 -1
  179. package/lib/javascript/EnableChunkLoadingPlugin.js +1 -1
  180. package/lib/javascript/JavascriptGenerator.js +1 -1
  181. package/lib/javascript/JavascriptModulesPlugin.js +16 -16
  182. package/lib/javascript/JavascriptParser.js +90 -83
  183. package/lib/javascript/JavascriptParserHelpers.js +3 -3
  184. package/lib/javascript/StartupHelpers.js +2 -2
  185. package/lib/json/JsonGenerator.js +2 -2
  186. package/lib/json/JsonModulesPlugin.js +2 -2
  187. package/lib/library/AbstractLibraryPlugin.js +3 -3
  188. package/lib/library/AmdLibraryPlugin.js +3 -3
  189. package/lib/library/AssignLibraryPlugin.js +2 -2
  190. package/lib/library/EnableLibraryPlugin.js +2 -2
  191. package/lib/library/ModuleLibraryPlugin.js +7 -2
  192. package/lib/library/SystemLibraryPlugin.js +6 -4
  193. package/lib/library/UmdLibraryPlugin.js +14 -14
  194. package/lib/logging/createConsoleLogger.js +4 -4
  195. package/lib/logging/runtime.js +3 -3
  196. package/lib/logging/truncateArgs.js +4 -4
  197. package/lib/node/CommonJsChunkLoadingPlugin.js +2 -2
  198. package/lib/node/NodeEnvironmentPlugin.js +1 -1
  199. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +16 -14
  200. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +7 -7
  201. package/lib/node/ReadFileCompileWasmPlugin.js +7 -7
  202. package/lib/node/RequireChunkLoadingRuntimeModule.js +6 -4
  203. package/lib/node/nodeConsole.js +2 -2
  204. package/lib/optimize/AggressiveMergingPlugin.js +2 -2
  205. package/lib/optimize/AggressiveSplittingPlugin.js +10 -10
  206. package/lib/optimize/ConcatenatedModule.js +161 -52
  207. package/lib/optimize/EnsureChunkConditionsPlugin.js +2 -2
  208. package/lib/optimize/FlagIncludedChunksPlugin.js +2 -2
  209. package/lib/optimize/InnerGraph.js +5 -5
  210. package/lib/optimize/InnerGraphPlugin.js +14 -12
  211. package/lib/optimize/LimitChunkCountPlugin.js +5 -5
  212. package/lib/optimize/MangleExportsPlugin.js +5 -5
  213. package/lib/optimize/MergeDuplicateChunksPlugin.js +2 -2
  214. package/lib/optimize/MinChunkSizePlugin.js +3 -3
  215. package/lib/optimize/ModuleConcatenationPlugin.js +45 -38
  216. package/lib/optimize/RealContentHashPlugin.js +23 -23
  217. package/lib/optimize/RemoveEmptyChunksPlugin.js +2 -2
  218. package/lib/optimize/RemoveParentModulesPlugin.js +3 -3
  219. package/lib/optimize/RuntimeChunkPlugin.js +2 -2
  220. package/lib/optimize/SideEffectsFlagPlugin.js +22 -6
  221. package/lib/optimize/SplitChunksPlugin.js +20 -20
  222. package/lib/performance/AssetsOverSizeLimitWarning.js +1 -1
  223. package/lib/performance/EntrypointsOverSizeLimitWarning.js +2 -2
  224. package/lib/performance/SizeLimitsPlugin.js +4 -4
  225. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +1 -1
  226. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +3 -3
  227. package/lib/rules/BasicMatcherRulePlugin.js +1 -1
  228. package/lib/rules/RuleSetCompiler.js +10 -10
  229. package/lib/rules/UseEffectRulePlugin.js +2 -2
  230. package/lib/runtime/GetChunkFilenameRuntimeModule.js +15 -15
  231. package/lib/runtime/GetMainFilenameRuntimeModule.js +1 -1
  232. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +1 -1
  233. package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +1 -1
  234. package/lib/runtime/StartupChunkDependenciesPlugin.js +2 -2
  235. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +3 -3
  236. package/lib/schemes/DataUriPlugin.js +3 -3
  237. package/lib/schemes/FileUriPlugin.js +1 -1
  238. package/lib/schemes/HttpUriPlugin.js +40 -36
  239. package/lib/schemes/VirtualUrlPlugin.js +1 -1
  240. package/lib/serialization/BinaryMiddleware.js +11 -11
  241. package/lib/serialization/FileMiddleware.js +17 -17
  242. package/lib/serialization/ObjectMiddleware.js +8 -8
  243. package/lib/serialization/Serializer.js +2 -2
  244. package/lib/serialization/SerializerMiddleware.js +2 -2
  245. package/lib/sharing/ConsumeSharedPlugin.js +4 -4
  246. package/lib/sharing/ProvideSharedPlugin.js +4 -4
  247. package/lib/sharing/SharePlugin.js +1 -1
  248. package/lib/sharing/resolveMatchedConfigs.js +1 -1
  249. package/lib/stats/DefaultStatsFactoryPlugin.js +86 -80
  250. package/lib/stats/DefaultStatsPresetPlugin.js +15 -15
  251. package/lib/stats/DefaultStatsPrinterPlugin.js +87 -87
  252. package/lib/stats/StatsFactory.js +7 -7
  253. package/lib/stats/StatsPrinter.js +9 -9
  254. package/lib/url/URLParserPlugin.js +5 -5
  255. package/lib/util/AsyncQueue.js +4 -4
  256. package/lib/util/IterableHelpers.js +2 -2
  257. package/lib/util/LazyBucketSortedSet.js +3 -3
  258. package/lib/util/SetHelpers.js +2 -2
  259. package/lib/util/StackedCacheMap.js +1 -1
  260. package/lib/util/StackedMap.js +1 -1
  261. package/lib/util/TupleSet.js +1 -1
  262. package/lib/util/WeakTupleMap.js +1 -1
  263. package/lib/util/cleverMerge.js +8 -8
  264. package/lib/util/comparators.js +107 -8
  265. package/lib/util/compileBooleanMatcher.js +20 -20
  266. package/lib/util/concatenate.js +3 -3
  267. package/lib/util/conventions.js +4 -4
  268. package/lib/util/create-schema-validation.js +1 -1
  269. package/lib/util/createHash.js +1 -1
  270. package/lib/util/deprecation.js +4 -4
  271. package/lib/util/deterministicGrouping.js +7 -7
  272. package/lib/util/findGraphRoots.js +1 -1
  273. package/lib/util/fs.js +3 -3
  274. package/lib/util/identifier.js +14 -14
  275. package/lib/util/magicComment.js +5 -1
  276. package/lib/util/memoize.js +1 -1
  277. package/lib/util/processAsyncTree.js +2 -2
  278. package/lib/util/propertyName.js +1 -1
  279. package/lib/util/removeBOM.js +1 -1
  280. package/lib/util/runtime.js +6 -6
  281. package/lib/util/semver.js +16 -16
  282. package/lib/util/serialization.js +5 -5
  283. package/lib/util/smartGrouping.js +1 -1
  284. package/lib/validateSchema.js +2 -2
  285. package/lib/wasm/EnableWasmLoadingPlugin.js +1 -1
  286. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +1 -1
  287. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +1 -1
  288. package/lib/wasm-async/UniversalCompileAsyncWasmPlugin.js +4 -4
  289. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +13 -9
  290. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +2 -2
  291. package/lib/wasm-sync/WebAssemblyGenerator.js +14 -14
  292. package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +4 -2
  293. package/lib/wasm-sync/WebAssemblyParser.js +2 -2
  294. package/lib/web/FetchCompileAsyncWasmPlugin.js +4 -4
  295. package/lib/web/FetchCompileWasmPlugin.js +4 -4
  296. package/lib/web/JsonpChunkLoadingPlugin.js +2 -2
  297. package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -1
  298. package/lib/webpack.js +17 -12
  299. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +2 -2
  300. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
  301. package/package.json +13 -13
  302. package/schemas/WebpackOptions.check.js +1 -1
  303. package/schemas/WebpackOptions.json +4 -0
  304. package/types.d.ts +186 -54
@@ -130,7 +130,7 @@ class RuntimeValue {
130
130
  */
131
131
  function getObjKeys(properties) {
132
132
  if (!properties) return;
133
- return new Set([...properties].map(p => p.id));
133
+ return new Set([...properties].map((p) => p.id));
134
134
  }
135
135
 
136
136
  /** @typedef {Set<string> | null} ObjKeys */
@@ -161,7 +161,7 @@ const stringifyObj = (
161
161
  const arr = Array.isArray(obj);
162
162
  if (arr) {
163
163
  code = `[${obj
164
- .map(code =>
164
+ .map((code) =>
165
165
  toCode(
166
166
  code,
167
167
  parser,
@@ -176,10 +176,10 @@ const stringifyObj = (
176
176
  } else {
177
177
  let keys = Object.keys(obj);
178
178
  if (objKeys) {
179
- keys = objKeys.size === 0 ? [] : keys.filter(k => objKeys.has(k));
179
+ keys = objKeys.size === 0 ? [] : keys.filter((k) => objKeys.has(k));
180
180
  }
181
181
  code = `{${keys
182
- .map(key => {
182
+ .map((key) => {
183
183
  const code = obj[key];
184
184
  return `${JSON.stringify(key)}:${toCode(
185
185
  code,
@@ -286,7 +286,7 @@ const toCode = (
286
286
  * @param {CodeValue} code code
287
287
  * @returns {string | undefined} result
288
288
  */
289
- const toCacheVersion = code => {
289
+ const toCacheVersion = (code) => {
290
290
  if (code === null) {
291
291
  return "null";
292
292
  }
@@ -306,7 +306,7 @@ const toCacheVersion = code => {
306
306
  return `(${code.toString()})`;
307
307
  }
308
308
  if (typeof code === "object") {
309
- const items = Object.keys(code).map(key => ({
309
+ const items = Object.keys(code).map((key) => ({
310
310
  key,
311
311
  value: toCacheVersion(
312
312
  /** @type {Record<string, EXPECTED_ANY>} */
@@ -390,7 +390,7 @@ class DefinePlugin {
390
390
  * @param {JavascriptParser} parser Parser
391
391
  * @returns {void}
392
392
  */
393
- const handler = parser => {
393
+ const handler = (parser) => {
394
394
  const hooked = new Set();
395
395
  const mainValue =
396
396
  /** @type {ValueCacheVersion} */
@@ -408,7 +408,7 @@ class DefinePlugin {
408
408
  /**
409
409
  * @param {string} key key
410
410
  */
411
- const addValueDependency = key => {
411
+ const addValueDependency = (key) => {
412
412
  const buildInfo =
413
413
  /** @type {BuildInfo} */
414
414
  (parser.state.module.buildInfo);
@@ -495,7 +495,7 @@ class DefinePlugin {
495
495
  // why 100? Ensures it runs after object define
496
496
  stage: 100
497
497
  },
498
- expr => {
498
+ (expr) => {
499
499
  const destructed =
500
500
  parser.destructuringAssignmentPropertiesFor(expr);
501
501
  if (destructed === undefined) {
@@ -557,7 +557,7 @@ class DefinePlugin {
557
557
  });
558
558
  parser.hooks.evaluateIdentifier
559
559
  .for(key)
560
- .tap(PLUGIN_NAME, expr => {
560
+ .tap(PLUGIN_NAME, (expr) => {
561
561
  /**
562
562
  * this is needed in case there is a recursion in the DefinePlugin
563
563
  * to prevent an endless recursion
@@ -584,7 +584,7 @@ class DefinePlugin {
584
584
  res.setRange(/** @type {Range} */ (expr.range));
585
585
  return res;
586
586
  });
587
- parser.hooks.expression.for(key).tap(PLUGIN_NAME, expr => {
587
+ parser.hooks.expression.for(key).tap(PLUGIN_NAME, (expr) => {
588
588
  addValueDependency(originalKey);
589
589
  let strCode = toCode(
590
590
  code,
@@ -613,7 +613,7 @@ class DefinePlugin {
613
613
  return toConstantDependency(parser, strCode)(expr);
614
614
  });
615
615
  }
616
- parser.hooks.evaluateTypeof.for(key).tap(PLUGIN_NAME, expr => {
616
+ parser.hooks.evaluateTypeof.for(key).tap(PLUGIN_NAME, (expr) => {
617
617
  /**
618
618
  * this is needed in case there is a recursion in the DefinePlugin
619
619
  * to prevent an endless recursion
@@ -640,7 +640,7 @@ class DefinePlugin {
640
640
  res.setRange(/** @type {Range} */ (expr.range));
641
641
  return res;
642
642
  });
643
- parser.hooks.typeof.for(key).tap(PLUGIN_NAME, expr => {
643
+ parser.hooks.typeof.for(key).tap(PLUGIN_NAME, (expr) => {
644
644
  addValueDependency(originalKey);
645
645
  const codeCode = toCode(
646
646
  code,
@@ -672,20 +672,22 @@ class DefinePlugin {
672
672
  addValueDependency(key);
673
673
  return true;
674
674
  });
675
- parser.hooks.evaluateIdentifier.for(key).tap(PLUGIN_NAME, expr => {
676
- addValueDependency(key);
677
- return new BasicEvaluatedExpression()
678
- .setTruthy()
679
- .setSideEffects(false)
680
- .setRange(/** @type {Range} */ (expr.range));
681
- });
675
+ parser.hooks.evaluateIdentifier
676
+ .for(key)
677
+ .tap(PLUGIN_NAME, (expr) => {
678
+ addValueDependency(key);
679
+ return new BasicEvaluatedExpression()
680
+ .setTruthy()
681
+ .setSideEffects(false)
682
+ .setRange(/** @type {Range} */ (expr.range));
683
+ });
682
684
  parser.hooks.evaluateTypeof
683
685
  .for(key)
684
686
  .tap(
685
687
  PLUGIN_NAME,
686
688
  withValueDependency(key, evaluateToString("object"))
687
689
  );
688
- parser.hooks.expression.for(key).tap(PLUGIN_NAME, expr => {
690
+ parser.hooks.expression.for(key).tap(PLUGIN_NAME, (expr) => {
689
691
  addValueDependency(key);
690
692
  let strCode = stringifyObj(
691
693
  obj,
@@ -778,7 +780,7 @@ class DefinePlugin {
778
780
  * @param {Record<string, CodeValue>} definitions Definitions map
779
781
  * @returns {void}
780
782
  */
781
- const walkDefinitionsForKeys = definitions => {
783
+ const walkDefinitionsForKeys = (definitions) => {
782
784
  /**
783
785
  * @param {Map<string, Set<string>>} map Map
784
786
  * @param {string} key key
@@ -92,7 +92,7 @@ class DelegatedModuleFactoryPlugin {
92
92
  }
93
93
  );
94
94
  } else {
95
- normalModuleFactory.hooks.module.tap(PLUGIN_NAME, module => {
95
+ normalModuleFactory.hooks.module.tap(PLUGIN_NAME, (module) => {
96
96
  const request = module.libIdent(this.options);
97
97
  if (request && request in this.options.content) {
98
98
  const resolved = this.options.content[request];
@@ -64,7 +64,7 @@ class DllEntryPlugin {
64
64
  this.options.name
65
65
  ),
66
66
  this.options,
67
- error => {
67
+ (error) => {
68
68
  if (error) return callback(error);
69
69
  callback();
70
70
  }
@@ -102,7 +102,7 @@ class DllReferencePlugin {
102
102
  return callback();
103
103
  });
104
104
 
105
- compiler.hooks.compile.tap(PLUGIN_NAME, params => {
105
+ compiler.hooks.compile.tap(PLUGIN_NAME, (params) => {
106
106
  let name = this.options.name;
107
107
  let sourceType = this.options.sourceType;
108
108
  let resolvedContent =
@@ -43,9 +43,9 @@ class DynamicEntryPlugin {
43
43
  }
44
44
  );
45
45
 
46
- compiler.hooks.make.tapPromise(PLUGIN_NAME, compilation =>
46
+ compiler.hooks.make.tapPromise(PLUGIN_NAME, (compilation) =>
47
47
  Promise.resolve(this.entry())
48
- .then(entry => {
48
+ .then((entry) => {
49
49
  const promises = [];
50
50
  for (const name of Object.keys(entry)) {
51
51
  const desc = entry[name];
@@ -68,7 +68,7 @@ class DynamicEntryPlugin {
68
68
  this.context,
69
69
  EntryPlugin.createDependency(entry, options),
70
70
  options,
71
- err => {
71
+ (err) => {
72
72
  if (err) return reject(err);
73
73
  resolve();
74
74
  }
@@ -45,7 +45,7 @@ class EntryPlugin {
45
45
  const dep = EntryPlugin.createDependency(entry, options);
46
46
 
47
47
  compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation, callback) => {
48
- compilation.addEntry(context, dep, options, err => {
48
+ compilation.addEntry(context, dep, options, (err) => {
49
49
  callback(err);
50
50
  });
51
51
  });
@@ -48,7 +48,7 @@ class EnvironmentPlugin {
48
48
  : this.defaultValues[key];
49
49
 
50
50
  if (value === undefined) {
51
- compiler.hooks.thisCompilation.tap(PLUGIN_NAME, compilation => {
51
+ compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
52
52
  const error = new WebpackError(
53
53
  `${PLUGIN_NAME} - ${key} environment variable is undefined.\n\n` +
54
54
  "You can pass an object with default values to suppress this warning.\n" +
@@ -28,13 +28,13 @@ const cutOffByFlag = (stack, flag) => {
28
28
  * @param {string} stack stack trace
29
29
  * @returns {string} stack trace without the loader execution flag included
30
30
  */
31
- const cutOffLoaderExecution = stack => cutOffByFlag(stack, loaderFlag);
31
+ const cutOffLoaderExecution = (stack) => cutOffByFlag(stack, loaderFlag);
32
32
 
33
33
  /**
34
34
  * @param {string} stack stack trace
35
35
  * @returns {string} stack trace without the webpack options flag included
36
36
  */
37
- const cutOffWebpackOptions = stack => cutOffByFlag(stack, webpackOptionsFlag);
37
+ const cutOffWebpackOptions = (stack) => cutOffByFlag(stack, webpackOptionsFlag);
38
38
 
39
39
  /**
40
40
  * @param {string} stack stack trace
@@ -55,7 +55,7 @@ class EvalDevToolModulePlugin {
55
55
  * @returns {void}
56
56
  */
57
57
  apply(compiler) {
58
- compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => {
58
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
59
59
  const hooks = JavascriptModulesPlugin.getCompilationHooks(compilation);
60
60
  hooks.renderModuleContent.tap(
61
61
  PLUGIN_NAME,
@@ -110,7 +110,7 @@ class EvalDevToolModulePlugin {
110
110
  );
111
111
  hooks.render.tap(
112
112
  PLUGIN_NAME,
113
- source => new ConcatSource(devtoolWarning, source)
113
+ (source) => new ConcatSource(devtoolWarning, source)
114
114
  );
115
115
  hooks.chunkHash.tap(PLUGIN_NAME, (chunk, hash) => {
116
116
  hash.update(PLUGIN_NAME);
@@ -69,7 +69,7 @@ class EvalSourceMapDevToolPlugin {
69
69
  */
70
70
  apply(compiler) {
71
71
  const options = this.options;
72
- compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => {
72
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
73
73
  const hooks = JavascriptModulesPlugin.getCompilationHooks(compilation);
74
74
  new SourceMapDevToolModuleOptionsPlugin(options).apply(compilation);
75
75
  const matchModule = ModuleFilenameHelpers.matchObject.bind(
@@ -88,7 +88,7 @@ class EvalSourceMapDevToolPlugin {
88
88
  * @param {Source} r result
89
89
  * @returns {Source} result
90
90
  */
91
- const result = r => {
91
+ const result = (r) => {
92
92
  cache.set(source, r);
93
93
  return r;
94
94
  };
@@ -136,13 +136,13 @@ class EvalSourceMapDevToolPlugin {
136
136
  sourceMap = { ...sourceMap };
137
137
  const context = /** @type {string} */ (compiler.options.context);
138
138
  const root = compiler.root;
139
- const modules = sourceMap.sources.map(source => {
139
+ const modules = sourceMap.sources.map((source) => {
140
140
  if (!source.startsWith("webpack://")) return source;
141
141
  source = makePathsAbsolute(context, source.slice(10), root);
142
142
  const module = compilation.findModule(source);
143
143
  return module || source;
144
144
  });
145
- let moduleFilenames = modules.map(module =>
145
+ let moduleFilenames = modules.map((module) =>
146
146
  ModuleFilenameHelpers.createFilename(
147
147
  module,
148
148
  {
@@ -205,7 +205,7 @@ class EvalSourceMapDevToolPlugin {
205
205
  );
206
206
  hooks.render.tap(
207
207
  PLUGIN_NAME,
208
- source => new ConcatSource(devtoolWarning, source)
208
+ (source) => new ConcatSource(devtoolWarning, source)
209
209
  );
210
210
  hooks.chunkHash.tap(PLUGIN_NAME, (chunk, hash) => {
211
211
  hash.update(PLUGIN_NAME);
@@ -142,7 +142,7 @@ class ExportsInfo {
142
142
  if (this._redirectTo !== undefined) {
143
143
  /** @type {Exports} */
144
144
  const map = new Map(
145
- Array.from(this._redirectTo.orderedExports, item => [item.name, item])
145
+ Array.from(this._redirectTo.orderedExports, (item) => [item.name, item])
146
146
  );
147
147
  for (const [key, value] of this._exports) {
148
148
  map.set(key, value);
@@ -402,7 +402,7 @@ class ExportsInfo {
402
402
  } else {
403
403
  if (
404
404
  this._otherExportsInfo.setUsedConditionally(
405
- used => used < UsageState.Unknown,
405
+ (used) => used < UsageState.Unknown,
406
406
  UsageState.Unknown,
407
407
  runtime
408
408
  )
@@ -465,7 +465,7 @@ class ExportsInfo {
465
465
  */
466
466
  setUsedForSideEffectsOnly(runtime) {
467
467
  return this._sideEffectsOnlyInfo.setUsedConditionally(
468
- used => used === UsageState.Unused,
468
+ (used) => used === UsageState.Unused,
469
469
  UsageState.Used,
470
470
  runtime
471
471
  );
@@ -988,7 +988,7 @@ class ExportInfo {
988
988
  let changed = false;
989
989
  if (
990
990
  this.setUsedConditionally(
991
- used => used < UsageState.Unknown,
991
+ (used) => used < UsageState.Unknown,
992
992
  UsageState.Unknown,
993
993
  runtime
994
994
  )
@@ -1050,7 +1050,7 @@ class ExportInfo {
1050
1050
  } else if (this._usedInRuntime === undefined) {
1051
1051
  if (newValue !== UsageState.Unused && condition(UsageState.Unused)) {
1052
1052
  this._usedInRuntime = new Map();
1053
- forEachRuntime(runtime, runtime =>
1053
+ forEachRuntime(runtime, (runtime) =>
1054
1054
  /** @type {UsedInRuntime} */
1055
1055
  (this._usedInRuntime).set(/** @type {string} */ (runtime), newValue)
1056
1056
  );
@@ -1058,7 +1058,7 @@ class ExportInfo {
1058
1058
  }
1059
1059
  } else {
1060
1060
  let changed = false;
1061
- forEachRuntime(runtime, _runtime => {
1061
+ forEachRuntime(runtime, (_runtime) => {
1062
1062
  const runtime = /** @type {string} */ (_runtime);
1063
1063
  const usedInRuntime =
1064
1064
  /** @type {UsedInRuntime} */
@@ -1098,7 +1098,7 @@ class ExportInfo {
1098
1098
  } else if (this._usedInRuntime === undefined) {
1099
1099
  if (newValue !== UsageState.Unused) {
1100
1100
  this._usedInRuntime = new Map();
1101
- forEachRuntime(runtime, runtime =>
1101
+ forEachRuntime(runtime, (runtime) =>
1102
1102
  /** @type {UsedInRuntime} */
1103
1103
  (this._usedInRuntime).set(/** @type {string} */ (runtime), newValue)
1104
1104
  );
@@ -1106,7 +1106,7 @@ class ExportInfo {
1106
1106
  }
1107
1107
  } else {
1108
1108
  let changed = false;
1109
- forEachRuntime(runtime, _runtime => {
1109
+ forEachRuntime(runtime, (_runtime) => {
1110
1110
  const runtime = /** @type {string} */ (_runtime);
1111
1111
  const usedInRuntime =
1112
1112
  /** @type {UsedInRuntime} */
@@ -1247,7 +1247,7 @@ class ExportInfo {
1247
1247
  } else if (
1248
1248
  runtime !== undefined &&
1249
1249
  [...runtime].every(
1250
- runtime =>
1250
+ (runtime) =>
1251
1251
  !(/** @type {UsedInRuntime} */ (this._usedInRuntime).has(runtime))
1252
1252
  )
1253
1253
  ) {
@@ -38,7 +38,7 @@ class ExportsInfoApiPlugin {
38
38
  * @param {JavascriptParser} parser the parser
39
39
  * @returns {void}
40
40
  */
41
- const handler = parser => {
41
+ const handler = (parser) => {
42
42
  parser.hooks.expressionMemberChain
43
43
  .for("__webpack_exports_info__")
44
44
  .tap(PLUGIN_NAME, (expr, members) => {
@@ -60,7 +60,7 @@ class ExportsInfoApiPlugin {
60
60
  });
61
61
  parser.hooks.expression
62
62
  .for("__webpack_exports_info__")
63
- .tap(PLUGIN_NAME, expr => {
63
+ .tap(PLUGIN_NAME, (expr) => {
64
64
  const dep = new ConstDependency(
65
65
  "true",
66
66
  /** @type {Range} */ (expr.range)