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
@@ -67,7 +67,7 @@ class RemoveParentModulesPlugin {
67
67
  * @returns {void}
68
68
  */
69
69
  apply(compiler) {
70
- compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => {
70
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
71
71
  /**
72
72
  * @param {Iterable<Chunk>} chunks the chunks
73
73
  * @param {ChunkGroup[]} chunkGroups the chunk groups
@@ -87,7 +87,7 @@ class RemoveParentModulesPlugin {
87
87
  * @param {Module} mod the module to get the mask for
88
88
  * @returns {bigint} the module mask to uniquely identify the module
89
89
  */
90
- const getOrCreateModuleMask = mod => {
90
+ const getOrCreateModuleMask = (mod) => {
91
91
  let id = maskByModule.get(mod);
92
92
  if (id === undefined) {
93
93
  id = nextModuleMask;
@@ -177,7 +177,7 @@ class RemoveParentModulesPlugin {
177
177
 
178
178
  const availableModulesSets = Array.from(
179
179
  chunk.groupsIterable,
180
- chunkGroup => availableModulesMap.get(chunkGroup)
180
+ (chunkGroup) => availableModulesMap.get(chunkGroup)
181
181
  );
182
182
  if (availableModulesSets.includes(undefined)) continue; // No info about this chunk group
183
183
 
@@ -20,7 +20,7 @@ class RuntimeChunkPlugin {
20
20
  constructor(options) {
21
21
  this.options = {
22
22
  /** @type {RuntimeChunkFunction} */
23
- name: entrypoint => `runtime~${entrypoint.name}`,
23
+ name: (entrypoint) => `runtime~${entrypoint.name}`,
24
24
  ...options
25
25
  };
26
26
  }
@@ -31,7 +31,7 @@ class RuntimeChunkPlugin {
31
31
  * @returns {void}
32
32
  */
33
33
  apply(compiler) {
34
- compiler.hooks.thisCompilation.tap(PLUGIN_NAME, compilation => {
34
+ compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
35
35
  compilation.hooks.addEntry.tap(PLUGIN_NAME, (_, { name: entryName }) => {
36
36
  if (entryName === undefined) return;
37
37
  const data =
@@ -131,7 +131,7 @@ class SideEffectsFlagPlugin {
131
131
  * @param {JavascriptParser} parser the parser
132
132
  * @returns {void}
133
133
  */
134
- const parserHandler = parser => {
134
+ const parserHandler = (parser) => {
135
135
  /** @type {undefined | Statement | ModuleDeclaration | MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration} */
136
136
  let sideEffectsStatement;
137
137
  parser.hooks.program.tap(PLUGIN_NAME, () => {
@@ -139,7 +139,7 @@ class SideEffectsFlagPlugin {
139
139
  });
140
140
  parser.hooks.statement.tap(
141
141
  { name: PLUGIN_NAME, stage: -100 },
142
- statement => {
142
+ (statement) => {
143
143
  if (sideEffectsStatement) return;
144
144
  if (parser.scope.topLevelScope !== true) return;
145
145
  switch (statement.type) {
@@ -277,7 +277,7 @@ class SideEffectsFlagPlugin {
277
277
  name: PLUGIN_NAME,
278
278
  stage: STAGE_DEFAULT
279
279
  },
280
- modules => {
280
+ (modules) => {
281
281
  const logger = compilation.getLogger(
282
282
  "webpack.SideEffectsFlagPlugin"
283
283
  );
@@ -289,7 +289,7 @@ class SideEffectsFlagPlugin {
289
289
  /**
290
290
  * @param {Module} module module
291
291
  */
292
- const optimizeIncomingConnections = module => {
292
+ const optimizeIncomingConnections = (module) => {
293
293
  if (optimizedModules.has(module)) return;
294
294
  optimizedModules.add(module);
295
295
  if (module.getSideEffectsConnectionState(moduleGraph) === false) {
@@ -410,7 +410,7 @@ class SideEffectsFlagPlugin {
410
410
  case "string":
411
411
  return globToRegexp(flagValue, cache).test(moduleName);
412
412
  case "object":
413
- return flagValue.some(glob =>
413
+ return flagValue.some((glob) =>
414
414
  SideEffectsFlagPlugin.moduleHasSideEffects(moduleName, glob, cache)
415
415
  );
416
416
  }
@@ -195,7 +195,7 @@ const hashFilename = (name, outputOptions) => {
195
195
  * @param {Chunk} chunk the chunk
196
196
  * @returns {number} the number of requests
197
197
  */
198
- const getRequests = chunk => {
198
+ const getRequests = (chunk) => {
199
199
  let requests = 0;
200
200
  for (const chunkGroup of chunk.groupsIterable) {
201
201
  requests = Math.max(requests, chunkGroup.chunks.length);
@@ -272,17 +272,17 @@ const compareEntries = (a, b) => {
272
272
  * @param {Chunk} chunk the chunk
273
273
  * @returns {boolean} true, if the chunk is an entry chunk
274
274
  */
275
- const INITIAL_CHUNK_FILTER = chunk => chunk.canBeInitial();
275
+ const INITIAL_CHUNK_FILTER = (chunk) => chunk.canBeInitial();
276
276
  /**
277
277
  * @param {Chunk} chunk the chunk
278
278
  * @returns {boolean} true, if the chunk is an async chunk
279
279
  */
280
- const ASYNC_CHUNK_FILTER = chunk => !chunk.canBeInitial();
280
+ const ASYNC_CHUNK_FILTER = (chunk) => !chunk.canBeInitial();
281
281
  /**
282
282
  * @param {Chunk} _chunk the chunk
283
283
  * @returns {boolean} always true
284
284
  */
285
- const ALL_CHUNK_FILTER = _chunk => true;
285
+ const ALL_CHUNK_FILTER = (_chunk) => true;
286
286
 
287
287
  /**
288
288
  * @param {OptimizationSplitChunksSizes | undefined} value the sizes
@@ -318,7 +318,7 @@ const mergeSizes = (...sizes) => {
318
318
  * @param {SplitChunksSizes} sizes the sizes
319
319
  * @returns {boolean} true, if there are sizes > 0
320
320
  */
321
- const hasNonZeroSizes = sizes => {
321
+ const hasNonZeroSizes = (sizes) => {
322
322
  for (const key of Object.keys(sizes)) {
323
323
  if (sizes[key] > 0) return true;
324
324
  }
@@ -398,7 +398,7 @@ const getViolatingMinSizes = (sizes, minSize) => {
398
398
  * @param {SplitChunksSizes} sizes the sizes
399
399
  * @returns {number} the total size
400
400
  */
401
- const totalSize = sizes => {
401
+ const totalSize = (sizes) => {
402
402
  let size = 0;
403
403
  for (const key of Object.keys(sizes)) {
404
404
  size += sizes[key];
@@ -410,7 +410,7 @@ const totalSize = sizes => {
410
410
  * @param {OptimizationSplitChunksCacheGroup["name"]} name the chunk name
411
411
  * @returns {GetName | undefined} a function to get the name of the chunk
412
412
  */
413
- const normalizeName = name => {
413
+ const normalizeName = (name) => {
414
414
  if (typeof name === "string") {
415
415
  return () => name;
416
416
  }
@@ -423,7 +423,7 @@ const normalizeName = name => {
423
423
  * @param {OptimizationSplitChunksCacheGroup["chunks"]} chunks the chunk filter option
424
424
  * @returns {ChunkFilterFunction | undefined} the chunk filter function
425
425
  */
426
- const normalizeChunksFilter = chunks => {
426
+ const normalizeChunksFilter = (chunks) => {
427
427
  if (chunks === "initial") {
428
428
  return INITIAL_CHUNK_FILTER;
429
429
  }
@@ -434,7 +434,7 @@ const normalizeChunksFilter = chunks => {
434
434
  return ALL_CHUNK_FILTER;
435
435
  }
436
436
  if (chunks instanceof RegExp) {
437
- return chunk => (chunk.name ? chunks.test(chunk.name) : false);
437
+ return (chunk) => (chunk.name ? chunks.test(chunk.name) : false);
438
438
  }
439
439
  if (typeof chunks === "function") {
440
440
  return chunks;
@@ -824,7 +824,7 @@ module.exports = class SplitChunksPlugin {
824
824
  compiler.context,
825
825
  compiler.root
826
826
  );
827
- compiler.hooks.thisCompilation.tap(PLUGIN_NAME, compilation => {
827
+ compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
828
828
  const logger = compilation.getLogger(`webpack.${PLUGIN_NAME}`);
829
829
  let alreadyOptimized = false;
830
830
  compilation.hooks.unseal.tap(PLUGIN_NAME, () => {
@@ -835,7 +835,7 @@ module.exports = class SplitChunksPlugin {
835
835
  name: PLUGIN_NAME,
836
836
  stage: STAGE_ADVANCED
837
837
  },
838
- chunks => {
838
+ (chunks) => {
839
839
  if (alreadyOptimized) return;
840
840
  alreadyOptimized = true;
841
841
  logger.time("prepare");
@@ -859,7 +859,7 @@ module.exports = class SplitChunksPlugin {
859
859
  * @param {Iterable<Chunk>} chunks list of chunks
860
860
  * @returns {bigint | Chunk} key of the chunks
861
861
  */
862
- const getKey = chunks => {
862
+ const getKey = (chunks) => {
863
863
  const iterator = chunks[Symbol.iterator]();
864
864
  let result = iterator.next();
865
865
  if (result.done) return ZERO;
@@ -879,7 +879,7 @@ module.exports = class SplitChunksPlugin {
879
879
  * @param {bigint | Chunk} key key of the chunks
880
880
  * @returns {string} stringified key
881
881
  */
882
- const keyToString = key => {
882
+ const keyToString = (key) => {
883
883
  if (typeof key === "bigint") return key.toString(16);
884
884
  return /** @type {bigint} */ (chunkIndexMap.get(key)).toString(16);
885
885
  };
@@ -907,7 +907,7 @@ module.exports = class SplitChunksPlugin {
907
907
  * @param {Module} module the module
908
908
  * @returns {Iterable<Chunk[]>} groups of chunks with equal exports
909
909
  */
910
- const groupChunksByExports = module => {
910
+ const groupChunksByExports = (module) => {
911
911
  const exportsInfo = moduleGraph.getExportsInfo(module);
912
912
  const groupedByUsedExports = new Map();
913
913
  for (const chunk of chunkGraph.getModuleChunksIterable(module)) {
@@ -954,7 +954,7 @@ module.exports = class SplitChunksPlugin {
954
954
  * @param {IterableIterator<Set<Chunk>>} chunkSets set of sets of chunks
955
955
  * @returns {Map<number, Array<Set<Chunk>>>} map of sets of chunks by count
956
956
  */
957
- const groupChunkSetsByCount = chunkSets => {
957
+ const groupChunkSetsByCount = (chunkSets) => {
958
958
  /** @type {Map<number, Array<Set<Chunk>>>} */
959
959
  const chunkSetsByCount = new Map();
960
960
  for (const chunksSet of chunkSets) {
@@ -994,7 +994,7 @@ module.exports = class SplitChunksPlugin {
994
994
  /** @type {Map<bigint | Chunk, (Set<Chunk> | Chunk)[]>} */
995
995
  const combinationsCache = new Map();
996
996
 
997
- return key => {
997
+ return (key) => {
998
998
  const cacheEntry = combinationsCache.get(key);
999
999
  if (cacheEntry !== undefined) return cacheEntry;
1000
1000
  if (key instanceof Chunk) {
@@ -1040,7 +1040,7 @@ module.exports = class SplitChunksPlugin {
1040
1040
  * @param {bigint | Chunk} key key
1041
1041
  * @returns {(Set<Chunk> | Chunk)[]} combinations by key
1042
1042
  */
1043
- const getCombinations = key => getCombinationsFactory()(key);
1043
+ const getCombinations = (key) => getCombinationsFactory()(key);
1044
1044
 
1045
1045
  const getExportsCombinationsFactory = memoize(() => {
1046
1046
  const { chunkSetsInGraph, singleChunkSets } =
@@ -1055,7 +1055,7 @@ module.exports = class SplitChunksPlugin {
1055
1055
  * @param {bigint | Chunk} key key
1056
1056
  * @returns {(Set<Chunk> | Chunk)[]} exports combinations by key
1057
1057
  */
1058
- const getExportsCombinations = key =>
1058
+ const getExportsCombinations = (key) =>
1059
1059
  getExportsCombinationsFactory()(key);
1060
1060
 
1061
1061
  /**
@@ -1321,7 +1321,7 @@ module.exports = class SplitChunksPlugin {
1321
1321
  const removeModulesWithSourceType = (info, sourceTypes) => {
1322
1322
  for (const module of info.modules) {
1323
1323
  const types = module.getSourceTypes();
1324
- if (sourceTypes.some(type => types.has(type))) {
1324
+ if (sourceTypes.some((type) => types.has(type))) {
1325
1325
  info.modules.delete(module);
1326
1326
  for (const type of types) {
1327
1327
  info.sizes[type] -= module.size(type);
@@ -1334,7 +1334,7 @@ module.exports = class SplitChunksPlugin {
1334
1334
  * @param {ChunksInfoItem} info entry
1335
1335
  * @returns {boolean} true, if entry become empty
1336
1336
  */
1337
- const removeMinSizeViolatingModules = info => {
1337
+ const removeMinSizeViolatingModules = (info) => {
1338
1338
  if (!info.cacheGroup._validateSize) return false;
1339
1339
  const violatingSizes = getViolatingMinSizes(
1340
1340
  info.sizes,
@@ -17,7 +17,7 @@ module.exports = class AssetsOverSizeLimitWarning extends WebpackError {
17
17
  */
18
18
  constructor(assetsOverSizeLimit, assetLimit) {
19
19
  const assetLists = assetsOverSizeLimit
20
- .map(asset => `\n ${asset.name} (${formatSize(asset.size)})`)
20
+ .map((asset) => `\n ${asset.name} (${formatSize(asset.size)})`)
21
21
  .join("");
22
22
 
23
23
  super(`asset size limit: The following asset(s) exceed the recommended size limit (${formatSize(
@@ -18,10 +18,10 @@ module.exports = class EntrypointsOverSizeLimitWarning extends WebpackError {
18
18
  constructor(entrypoints, entrypointLimit) {
19
19
  const entrypointList = entrypoints
20
20
  .map(
21
- entrypoint =>
21
+ (entrypoint) =>
22
22
  `\n ${entrypoint.name} (${formatSize(
23
23
  entrypoint.size
24
- )})\n${entrypoint.files.map(asset => ` ${asset}`).join("\n")}`
24
+ )})\n${entrypoint.files.map((asset) => ` ${asset}`).join("\n")}`
25
25
  )
26
26
  .join("");
27
27
  super(`entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (${formatSize(
@@ -73,7 +73,7 @@ module.exports = class SizeLimitsPlugin {
73
73
  const hints = this.hints;
74
74
  const assetFilter = this.assetFilter || excludeSourceMap;
75
75
 
76
- compiler.hooks.afterEmit.tap(PLUGIN_NAME, compilation => {
76
+ compiler.hooks.afterEmit.tap(PLUGIN_NAME, (compilation) => {
77
77
  /** @type {WebpackError[]} */
78
78
  const warnings = [];
79
79
 
@@ -81,7 +81,7 @@ module.exports = class SizeLimitsPlugin {
81
81
  * @param {Entrypoint} entrypoint an entrypoint
82
82
  * @returns {number} the size of the entrypoint
83
83
  */
84
- const getEntrypointSize = entrypoint => {
84
+ const getEntrypointSize = (entrypoint) => {
85
85
  let size = 0;
86
86
  for (const file of entrypoint.getFiles()) {
87
87
  const asset = compilation.getAsset(file);
@@ -117,7 +117,7 @@ module.exports = class SizeLimitsPlugin {
117
117
  * @param {Asset["name"]} name the name
118
118
  * @returns {boolean | undefined} result
119
119
  */
120
- const fileFilter = name => {
120
+ const fileFilter = (name) => {
121
121
  const asset = compilation.getAsset(name);
122
122
  return asset && assetFilter(asset.name, asset.source, asset.info);
123
123
  };
@@ -162,7 +162,7 @@ module.exports = class SizeLimitsPlugin {
162
162
  if (warnings.length > 0) {
163
163
  const someAsyncChunk = find(
164
164
  compilation.chunks,
165
- chunk => !chunk.canBeInitial()
165
+ (chunk) => !chunk.canBeInitial()
166
166
  );
167
167
 
168
168
  if (!someAsyncChunk) {
@@ -23,7 +23,7 @@ class ChunkPrefetchPreloadPlugin {
23
23
  * @returns {void}
24
24
  */
25
25
  apply(compiler) {
26
- compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => {
26
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
27
27
  compilation.hooks.additionalChunkRuntimeRequirements.tap(
28
28
  PLUGIN_NAME,
29
29
  (chunk, set, { chunkGraph }) => {
@@ -34,16 +34,16 @@ class ChunkPrefetchStartupRuntimeModule extends RuntimeModule {
34
34
  ({ onChunks, chunks }) =>
35
35
  `${RuntimeGlobals.onChunksLoaded}(0, ${JSON.stringify(
36
36
  // This need to include itself to delay execution after this chunk has been fully loaded
37
- onChunks.filter(c => c === chunk).map(c => c.id)
37
+ onChunks.filter((c) => c === chunk).map((c) => c.id)
38
38
  )}, ${runtimeTemplate.basicFunction(
39
39
  "",
40
40
  chunks.size < 3
41
41
  ? Array.from(
42
42
  chunks,
43
- c =>
43
+ (c) =>
44
44
  `${RuntimeGlobals.prefetchChunk}(${JSON.stringify(c.id)});`
45
45
  )
46
- : `${JSON.stringify(Array.from(chunks, c => c.id))}.map(${
46
+ : `${JSON.stringify(Array.from(chunks, (c) => c.id))}.map(${
47
47
  RuntimeGlobals.prefetchChunk
48
48
  });`
49
49
  )}, 5);`
@@ -56,7 +56,7 @@ class BasicMatcherRulePlugin {
56
56
  matchWhenEmpty: this.invert
57
57
  ? !condition.matchWhenEmpty
58
58
  : condition.matchWhenEmpty,
59
- fn: this.invert ? v => !fn(v) : fn
59
+ fn: this.invert ? (v) => !fn(v) : fn
60
60
  });
61
61
  }
62
62
  }
@@ -183,7 +183,7 @@ class RuleSetCompiler {
183
183
 
184
184
  return {
185
185
  references: refs,
186
- exec: data => {
186
+ exec: (data) => {
187
187
  /** @type {Effect[]} */
188
188
  const effects = [];
189
189
  for (const rule of rules) {
@@ -222,7 +222,7 @@ class RuleSetCompiler {
222
222
  /** @type {Set<string>} */
223
223
  const unhandledProperties = new Set(
224
224
  Object.keys(rule).filter(
225
- key => rule[/** @type {keyof RuleSetRule} */ (key)] !== undefined
225
+ (key) => rule[/** @type {keyof RuleSetRule} */ (key)] !== undefined
226
226
  )
227
227
  );
228
228
 
@@ -274,7 +274,7 @@ class RuleSetCompiler {
274
274
  if (condition === "") {
275
275
  return {
276
276
  matchWhenEmpty: true,
277
- fn: str => str === ""
277
+ fn: (str) => str === ""
278
278
  };
279
279
  }
280
280
  if (!condition) {
@@ -287,7 +287,7 @@ class RuleSetCompiler {
287
287
  if (typeof condition === "string") {
288
288
  return {
289
289
  matchWhenEmpty: condition.length === 0,
290
- fn: str => typeof str === "string" && str.startsWith(condition)
290
+ fn: (str) => typeof str === "string" && str.startsWith(condition)
291
291
  };
292
292
  }
293
293
  if (typeof condition === "function") {
@@ -307,7 +307,7 @@ class RuleSetCompiler {
307
307
  if (condition instanceof RegExp) {
308
308
  return {
309
309
  matchWhenEmpty: condition.test(""),
310
- fn: v => typeof v === "string" && condition.test(v)
310
+ fn: (v) => typeof v === "string" && condition.test(v)
311
311
  };
312
312
  }
313
313
  if (Array.isArray(condition)) {
@@ -363,7 +363,7 @@ class RuleSetCompiler {
363
363
  const fn = matcher.fn;
364
364
  conditions.push({
365
365
  matchWhenEmpty: !matcher.matchWhenEmpty,
366
- fn: /** @type {RuleConditionFunction} */ (v => !fn(v))
366
+ fn: /** @type {RuleConditionFunction} */ ((v) => !fn(v))
367
367
  });
368
368
  }
369
369
  break;
@@ -399,8 +399,8 @@ class RuleSetCompiler {
399
399
  return conditions[0];
400
400
  }
401
401
  return {
402
- matchWhenEmpty: conditions.some(c => c.matchWhenEmpty),
403
- fn: v => conditions.some(c => c.fn(v))
402
+ matchWhenEmpty: conditions.some((c) => c.matchWhenEmpty),
403
+ fn: (v) => conditions.some((c) => c.fn(v))
404
404
  };
405
405
  }
406
406
 
@@ -418,8 +418,8 @@ class RuleSetCompiler {
418
418
  return conditions[0];
419
419
  }
420
420
  return {
421
- matchWhenEmpty: conditions.every(c => c.matchWhenEmpty),
422
- fn: v => conditions.every(c => c.fn(v))
421
+ matchWhenEmpty: conditions.every((c) => c.matchWhenEmpty),
422
+ fn: (v) => conditions.every((c) => c.fn(v))
423
423
  };
424
424
  }
425
425
 
@@ -65,7 +65,7 @@ class UseEffectRulePlugin {
65
65
  */
66
66
  const useToEffect = (path, defaultIdent, item) => {
67
67
  if (typeof item === "function") {
68
- return data =>
68
+ return (data) =>
69
69
  useToEffectsWithoutIdent(
70
70
  path,
71
71
  /** @type {RuleSetUseItem | RuleSetUseItem[]} */
@@ -165,7 +165,7 @@ class UseEffectRulePlugin {
165
165
  };
166
166
 
167
167
  if (typeof use === "function") {
168
- result.effects.push(data =>
168
+ result.effects.push((data) =>
169
169
  useToEffectsWithoutIdent(`${path}.use`, use(data))
170
170
  );
171
171
  } else {
@@ -53,7 +53,7 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
53
53
  * @param {Chunk} c the chunk
54
54
  * @returns {void}
55
55
  */
56
- const addChunk = c => {
56
+ const addChunk = (c) => {
57
57
  const chunkFilename = getFilenameForChunk(c);
58
58
  if (chunkFilename) {
59
59
  let set = chunkFilenames.get(chunkFilename);
@@ -107,6 +107,10 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
107
107
  )) {
108
108
  addChunk(c);
109
109
  }
110
+ includedChunksMessages.push("chunks that the entrypoint depends on");
111
+ for (const c of chunkGraph.getChunkEntryDependOnChunksIterable(chunk)) {
112
+ addChunk(c);
113
+ }
110
114
  }
111
115
  }
112
116
  for (const entrypoint of chunk.getAllReferencedAsyncEntrypoints()) {
@@ -128,7 +132,7 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
128
132
  * @param {string | number} value a value
129
133
  * @returns {string} string to put in quotes
130
134
  */
131
- const unquotedStringify = value => {
135
+ const unquotedStringify = (value) => {
132
136
  const str = `${value}`;
133
137
  if (str.length >= 5 && str === `${c.id}`) {
134
138
  // This is shorter and generates the same result
@@ -141,7 +145,7 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
141
145
  * @param {string} value string
142
146
  * @returns {(length: number) => string} string to put in quotes with length
143
147
  */
144
- const unquotedStringifyWithLength = value => length =>
148
+ const unquotedStringifyWithLength = (value) => (length) =>
145
149
  unquotedStringify(`${value}`.slice(0, length));
146
150
  const chunkFilenameValue =
147
151
  typeof chunkFilename === "function"
@@ -154,7 +158,7 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
154
158
  : JSON.stringify(chunkFilename);
155
159
  const staticChunkFilename = compilation.getPath(chunkFilenameValue, {
156
160
  hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
157
- hashWithLength: length =>
161
+ hashWithLength: (length) =>
158
162
  `" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`,
159
163
  chunk: {
160
164
  id: unquotedStringify(/** @type {ChunkId} */ (c.id)),
@@ -193,7 +197,7 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
193
197
  * @param {(chunk: Chunk) => string | number} fn function from chunk to value
194
198
  * @returns {string} code with static mapping of results of fn
195
199
  */
196
- const createMap = fn => {
200
+ const createMap = (fn) => {
197
201
  /** @type {Record<number | string, number | string>} */
198
202
  const obj = {};
199
203
  let useId = false;
@@ -227,33 +231,33 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
227
231
  * @param {(chunk: Chunk) => string | number} fn function from chunk to value
228
232
  * @returns {string} code with static mapping of results of fn for including in quoted string
229
233
  */
230
- const mapExpr = fn => `" + ${createMap(fn)} + "`;
234
+ const mapExpr = (fn) => `" + ${createMap(fn)} + "`;
231
235
 
232
236
  /**
233
237
  * @param {(chunk: Chunk) => string | number} fn function from chunk to value
234
238
  * @returns {(length: number) => string} function which generates code with static mapping of results of fn for including in quoted string for specific length
235
239
  */
236
- const mapExprWithLength = fn => length =>
237
- `" + ${createMap(c => `${fn(c)}`.slice(0, length))} + "`;
240
+ const mapExprWithLength = (fn) => (length) =>
241
+ `" + ${createMap((c) => `${fn(c)}`.slice(0, length))} + "`;
238
242
 
239
243
  const url =
240
244
  dynamicFilename &&
241
245
  compilation.getPath(JSON.stringify(dynamicFilename), {
242
246
  hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
243
- hashWithLength: length =>
247
+ hashWithLength: (length) =>
244
248
  `" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`,
245
249
  chunk: {
246
250
  id: '" + chunkId + "',
247
- hash: mapExpr(c => /** @type {string} */ (c.renderedHash)),
251
+ hash: mapExpr((c) => /** @type {string} */ (c.renderedHash)),
248
252
  hashWithLength: mapExprWithLength(
249
- c => /** @type {string} */ (c.renderedHash)
253
+ (c) => /** @type {string} */ (c.renderedHash)
250
254
  ),
251
- name: mapExpr(c => c.name || /** @type {number | string} */ (c.id)),
255
+ name: mapExpr((c) => c.name || /** @type {number | string} */ (c.id)),
252
256
  contentHash: {
253
- [contentType]: mapExpr(c => c.contentHash[contentType])
257
+ [contentType]: mapExpr((c) => c.contentHash[contentType])
254
258
  },
255
259
  contentHashWithLength: {
256
- [contentType]: mapExprWithLength(c => c.contentHash[contentType])
260
+ [contentType]: mapExprWithLength((c) => c.contentHash[contentType])
257
261
  }
258
262
  },
259
263
  contentHashType: contentType
@@ -277,7 +281,7 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
277
281
  ? `chunkId === ${JSON.stringify(first(ids))}`
278
282
  : `{${Array.from(
279
283
  ids,
280
- id => `${JSON.stringify(id)}:1`
284
+ (id) => `${JSON.stringify(id)}:1`
281
285
  ).join(",")}}[chunkId]`;
282
286
  return `if (${condition}) return ${url};`;
283
287
  })
@@ -33,7 +33,7 @@ class GetMainFilenameRuntimeModule extends RuntimeModule {
33
33
  const { runtimeTemplate } = compilation;
34
34
  const url = compilation.getPath(JSON.stringify(filename), {
35
35
  hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
36
- hashWithLength: length =>
36
+ hashWithLength: (length) =>
37
37
  `" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`,
38
38
  chunk,
39
39
  runtime: chunk.runtime
@@ -69,7 +69,7 @@ class GetTrustedTypesPolicyRuntimeModule extends HelperRuntimeModule {
69
69
  `policy = trustedTypes.createPolicy(${JSON.stringify(
70
70
  trustedTypes.policyName
71
71
  )}, policy);`
72
- ].map(line =>
72
+ ].map((line) =>
73
73
  wrapPolicyCreationInTryCatch ? Template.indent(line) : line
74
74
  ),
75
75
  ...(wrapPolicyCreationInTryCatch
@@ -54,7 +54,7 @@ function getOptimizedDeferredModule(
54
54
  isAsync
55
55
  ? `[${
56
56
  RuntimeGlobals.makeDeferredNamespaceObjectSymbol
57
- }]: ${JSON.stringify(asyncDepsIds.filter(x => x !== null))}`
57
+ }]: ${JSON.stringify(asyncDepsIds.filter((x) => x !== null))}`
58
58
  : ""
59
59
  ];
60
60
  return Template.asString(["{", Template.indent(props), "}"]);
@@ -38,13 +38,13 @@ class StartupChunkDependenciesPlugin {
38
38
  * @returns {void}
39
39
  */
40
40
  apply(compiler) {
41
- compiler.hooks.thisCompilation.tap(PLUGIN_NAME, compilation => {
41
+ compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
42
42
  const globalChunkLoading = compilation.outputOptions.chunkLoading;
43
43
  /**
44
44
  * @param {Chunk} chunk chunk to check
45
45
  * @returns {boolean} true, when the plugin is enabled for the chunk
46
46
  */
47
- const isEnabledForChunk = chunk => {
47
+ const isEnabledForChunk = (chunk) => {
48
48
  const options = chunk.getEntryOptions();
49
49
  const chunkLoading =
50
50
  options && options.chunkLoading !== undefined
@@ -30,7 +30,7 @@ class StartupChunkDependenciesRuntimeModule extends RuntimeModule {
30
30
  const chunk = /** @type {Chunk} */ (this.chunk);
31
31
  const chunkIds = [
32
32
  ...chunkGraph.getChunkEntryDependentChunksIterable(chunk)
33
- ].map(chunk => chunk.id);
33
+ ].map((chunk) => chunk.id);
34
34
  const compilation = /** @type {Compilation} */ (this.compilation);
35
35
  const { runtimeTemplate } = compilation;
36
36
  return Template.asString([
@@ -40,7 +40,7 @@ class StartupChunkDependenciesRuntimeModule extends RuntimeModule {
40
40
  !this.asyncChunkLoading
41
41
  ? [
42
42
  ...chunkIds.map(
43
- id => `${RuntimeGlobals.ensureChunk}(${JSON.stringify(id)});`
43
+ (id) => `${RuntimeGlobals.ensureChunk}(${JSON.stringify(id)});`
44
44
  ),
45
45
  "return next();"
46
46
  ]
@@ -61,7 +61,7 @@ class StartupChunkDependenciesRuntimeModule extends RuntimeModule {
61
61
  Template.indent(
62
62
  chunkIds
63
63
  .map(
64
- id =>
64
+ (id) =>
65
65
  `${RuntimeGlobals.ensureChunk}(${JSON.stringify(id)})`
66
66
  )
67
67
  .join(",\n")
@@ -17,7 +17,7 @@ const URIRegEx = /^data:([^;,]+)?((?:;[^;,]+)*?)(?:;(base64)?)?,(.*)$/i;
17
17
  * @param {string} uri data URI
18
18
  * @returns {Buffer | null} decoded data
19
19
  */
20
- const decodeDataURI = uri => {
20
+ const decodeDataURI = (uri) => {
21
21
  const match = URIRegEx.exec(uri);
22
22
  if (!match) return null;
23
23
 
@@ -51,7 +51,7 @@ class DataUriPlugin {
51
51
  (compilation, { normalModuleFactory }) => {
52
52
  normalModuleFactory.hooks.resolveForScheme
53
53
  .for("data")
54
- .tap(PLUGIN_NAME, resourceData => {
54
+ .tap(PLUGIN_NAME, (resourceData) => {
55
55
  const match = URIRegEx.exec(resourceData.resource);
56
56
  if (match) {
57
57
  resourceData.data.mimetype = match[1] || "";
@@ -64,7 +64,7 @@ class DataUriPlugin {
64
64
  });
65
65
  NormalModule.getCompilationHooks(compilation)
66
66
  .readResourceForScheme.for("data")
67
- .tap(PLUGIN_NAME, resource => decodeDataURI(resource));
67
+ .tap(PLUGIN_NAME, (resource) => decodeDataURI(resource));
68
68
  }
69
69
  );
70
70
  }