xhs-mp-pack 1.1.0-beta.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 (798) hide show
  1. package/README.md +1 -0
  2. package/dist/Compilation.d.ts +239 -0
  3. package/dist/Compilation.js +3513 -0
  4. package/dist/Compiler.d.ts +76 -0
  5. package/dist/Compiler.js +845 -0
  6. package/dist/ConcatenationScope.d.ts +37 -0
  7. package/dist/ConcatenationScope.js +69 -0
  8. package/dist/FileSystemInfo.d.ts +183 -0
  9. package/dist/FileSystemInfo.js +2896 -0
  10. package/dist/MPPack.d.ts +33 -0
  11. package/dist/MPPack.js +163 -0
  12. package/dist/MPPackSetting.d.ts +52 -0
  13. package/dist/MPPackSetting.js +85 -0
  14. package/dist/MultiCompiler.d.ts +25 -0
  15. package/dist/MultiCompiler.js +387 -0
  16. package/dist/MultiWatching.d.ts +11 -0
  17. package/dist/MultiWatching.js +54 -0
  18. package/dist/PluginManager.d.ts +9 -0
  19. package/dist/PluginManager.js +359 -0
  20. package/dist/ResolverFactory.d.ts +7 -0
  21. package/dist/ResolverFactory.js +84 -0
  22. package/dist/Watching.d.ts +41 -0
  23. package/dist/Watching.js +359 -0
  24. package/dist/base/ArrayHelpers.d.ts +6 -0
  25. package/dist/base/ArrayHelpers.js +21 -0
  26. package/dist/base/ArrayQueue.d.ts +29 -0
  27. package/dist/base/ArrayQueue.js +87 -0
  28. package/dist/base/AsyncQueue.d.ts +37 -0
  29. package/dist/base/AsyncQueue.js +263 -0
  30. package/dist/base/ChunkHelpers.d.ts +3 -0
  31. package/dist/base/ChunkHelpers.js +26 -0
  32. package/dist/base/ConditionalInitFragment.d.ts +9 -0
  33. package/dist/base/ConditionalInitFragment.js +64 -0
  34. package/dist/base/GraphHelpers.d.ts +6 -0
  35. package/dist/base/GraphHelpers.js +32 -0
  36. package/dist/base/Hash.d.ts +6 -0
  37. package/dist/base/Hash.js +13 -0
  38. package/dist/base/InitFragment.d.ts +22 -0
  39. package/dist/base/InitFragment.js +113 -0
  40. package/dist/base/IterableHelpers.d.ts +4 -0
  41. package/dist/base/IterableHelpers.js +26 -0
  42. package/dist/base/LazyBucketSortedSet.d.ts +34 -0
  43. package/dist/base/LazyBucketSortedSet.js +188 -0
  44. package/dist/base/LazySet.d.ts +35 -0
  45. package/dist/base/LazySet.js +155 -0
  46. package/dist/base/MapHelpers.d.ts +14 -0
  47. package/dist/base/MapHelpers.js +27 -0
  48. package/dist/base/ModuleFilenameHelpers.d.ts +95 -0
  49. package/dist/base/ModuleFilenameHelpers.js +314 -0
  50. package/dist/base/NodeWatchFileSystem.d.ts +23 -0
  51. package/dist/base/NodeWatchFileSystem.js +135 -0
  52. package/dist/base/ParallelismFactorCalculator.d.ts +8 -0
  53. package/dist/base/ParallelismFactorCalculator.js +52 -0
  54. package/dist/base/Queue.d.ts +12 -0
  55. package/dist/base/Queue.js +25 -0
  56. package/dist/base/RequestShortener.d.ts +6 -0
  57. package/dist/base/RequestShortener.js +15 -0
  58. package/dist/base/Semaphore.d.ts +12 -0
  59. package/dist/base/Semaphore.js +37 -0
  60. package/dist/base/SetHelpers.d.ts +36 -0
  61. package/dist/base/SetHelpers.js +94 -0
  62. package/dist/base/SizeFormatHelpers.d.ts +2 -0
  63. package/dist/base/SizeFormatHelpers.js +15 -0
  64. package/dist/base/SizeOnlySource.d.ts +14 -0
  65. package/dist/base/SizeOnlySource.js +34 -0
  66. package/dist/base/SortableSet.d.ts +18 -0
  67. package/dist/base/SortableSet.js +90 -0
  68. package/dist/base/StackedCacheMap.d.ts +20 -0
  69. package/dist/base/StackedCacheMap.js +73 -0
  70. package/dist/base/StackedMap.d.ts +17 -0
  71. package/dist/base/StackedMap.js +103 -0
  72. package/dist/base/StartupHelpers.d.ts +4 -0
  73. package/dist/base/StartupHelpers.js +94 -0
  74. package/dist/base/StringXor.d.ts +53 -0
  75. package/dist/base/StringXor.js +94 -0
  76. package/dist/base/TupleQueue.d.ts +10 -0
  77. package/dist/base/TupleQueue.js +33 -0
  78. package/dist/base/TupleSet.d.ts +18 -0
  79. package/dist/base/TupleSet.js +115 -0
  80. package/dist/base/URLAbsoluteSpecifier.d.ts +3 -0
  81. package/dist/base/URLAbsoluteSpecifier.js +57 -0
  82. package/dist/base/WeakTupleMap.d.ts +20 -0
  83. package/dist/base/WeakTupleMap.js +124 -0
  84. package/dist/base/binarySearchBounds.d.ts +23 -0
  85. package/dist/base/binarySearchBounds.js +105 -0
  86. package/dist/base/cleverMerge.d.ts +27 -0
  87. package/dist/base/cleverMerge.js +450 -0
  88. package/dist/base/common.d.ts +7 -0
  89. package/dist/base/common.js +25 -0
  90. package/dist/base/commonjs.d.ts +1 -0
  91. package/dist/base/commonjs.js +48 -0
  92. package/dist/base/comparators.d.ts +22 -0
  93. package/dist/base/comparators.js +279 -0
  94. package/dist/base/compileBooleanMatcher.d.ts +6 -0
  95. package/dist/base/compileBooleanMatcher.js +162 -0
  96. package/dist/base/const.d.ts +29 -0
  97. package/dist/base/const.js +49 -0
  98. package/dist/base/copyPatterns.d.ts +14 -0
  99. package/dist/base/copyPatterns.js +501 -0
  100. package/dist/base/createHash.d.ts +3 -0
  101. package/dist/base/createHash.js +131 -0
  102. package/dist/base/defaults.d.ts +3 -0
  103. package/dist/base/defaults.js +671 -0
  104. package/dist/base/deprecation.d.ts +21 -0
  105. package/dist/base/deprecation.js +165 -0
  106. package/dist/base/deterministicGrouping.d.ts +8 -0
  107. package/dist/base/deterministicGrouping.js +395 -0
  108. package/dist/base/errors/AbstractMethodError.d.ts +5 -0
  109. package/dist/base/errors/AbstractMethodError.js +23 -0
  110. package/dist/base/errors/AsyncDependencyToInitialChunkError.d.ts +8 -0
  111. package/dist/base/errors/AsyncDependencyToInitialChunkError.js +18 -0
  112. package/dist/base/errors/BaseError.d.ts +17 -0
  113. package/dist/base/errors/BaseError.js +39 -0
  114. package/dist/base/errors/BuildCycleError.d.ts +8 -0
  115. package/dist/base/errors/BuildCycleError.js +17 -0
  116. package/dist/base/errors/CaseSensitiveModulesWarning.d.ts +5 -0
  117. package/dist/base/errors/CaseSensitiveModulesWarning.js +42 -0
  118. package/dist/base/errors/ChunkRenderError.d.ts +6 -0
  119. package/dist/base/errors/ChunkRenderError.js +18 -0
  120. package/dist/base/errors/CodeGenerationError.d.ts +8 -0
  121. package/dist/base/errors/CodeGenerationError.js +20 -0
  122. package/dist/base/errors/CommentCompilationWarning.d.ts +5 -0
  123. package/dist/base/errors/CommentCompilationWarning.js +16 -0
  124. package/dist/base/errors/ConcurrentCompilationError.d.ts +4 -0
  125. package/dist/base/errors/ConcurrentCompilationError.js +15 -0
  126. package/dist/base/errors/CriticalDependencyWarning.d.ts +5 -0
  127. package/dist/base/errors/CriticalDependencyWarning.js +16 -0
  128. package/dist/base/errors/ErrorHelpers.d.ts +8 -0
  129. package/dist/base/errors/ErrorHelpers.js +51 -0
  130. package/dist/base/errors/HarmonyLinkingError.d.ts +4 -0
  131. package/dist/base/errors/HarmonyLinkingError.js +14 -0
  132. package/dist/base/errors/HookBaseError.d.ts +10 -0
  133. package/dist/base/errors/HookBaseError.js +51 -0
  134. package/dist/base/errors/InvalidDependenciesModuleWarning.d.ts +5 -0
  135. package/dist/base/errors/InvalidDependenciesModuleWarning.js +26 -0
  136. package/dist/base/errors/MinMaxSizeWarning.d.ts +5 -0
  137. package/dist/base/errors/MinMaxSizeWarning.js +45 -0
  138. package/dist/base/errors/ModuleBuildError.d.ts +9 -0
  139. package/dist/base/errors/ModuleBuildError.js +62 -0
  140. package/dist/base/errors/ModuleDependencyError.d.ts +8 -0
  141. package/dist/base/errors/ModuleDependencyError.js +24 -0
  142. package/dist/base/errors/ModuleDependencyWarning.d.ts +6 -0
  143. package/dist/base/errors/ModuleDependencyWarning.js +23 -0
  144. package/dist/base/errors/ModuleError.d.ts +10 -0
  145. package/dist/base/errors/ModuleError.js +42 -0
  146. package/dist/base/errors/ModuleHashingError.d.ts +5 -0
  147. package/dist/base/errors/ModuleHashingError.js +17 -0
  148. package/dist/base/errors/ModuleNotFoundError.d.ts +5 -0
  149. package/dist/base/errors/ModuleNotFoundError.js +69 -0
  150. package/dist/base/errors/ModuleParseError.d.ts +8 -0
  151. package/dist/base/errors/ModuleParseError.js +77 -0
  152. package/dist/base/errors/ModuleRestoreError.d.ts +5 -0
  153. package/dist/base/errors/ModuleRestoreError.js +33 -0
  154. package/dist/base/errors/ModuleStoreError.d.ts +5 -0
  155. package/dist/base/errors/ModuleStoreError.js +33 -0
  156. package/dist/base/errors/ModuleWarning.d.ts +10 -0
  157. package/dist/base/errors/ModuleWarning.js +44 -0
  158. package/dist/base/errors/NodeStuffInWebError.d.ts +5 -0
  159. package/dist/base/errors/NodeStuffInWebError.js +17 -0
  160. package/dist/base/errors/UnhandledSchemeError.d.ts +5 -0
  161. package/dist/base/errors/UnhandledSchemeError.js +18 -0
  162. package/dist/base/errors/UnsupportedFeatureWarning.d.ts +5 -0
  163. package/dist/base/errors/UnsupportedFeatureWarning.js +17 -0
  164. package/dist/base/extractUrlAndGlobal.d.ts +1 -0
  165. package/dist/base/extractUrlAndGlobal.js +10 -0
  166. package/dist/base/findGraphRoots.d.ts +2 -0
  167. package/dist/base/findGraphRoots.js +183 -0
  168. package/dist/base/formatLocation.d.ts +2 -0
  169. package/dist/base/formatLocation.js +47 -0
  170. package/dist/base/fs.d.ts +94 -0
  171. package/dist/base/fs.js +218 -0
  172. package/dist/base/hash/BatchedHash.d.ts +11 -0
  173. package/dist/base/hash/BatchedHash.js +47 -0
  174. package/dist/base/hash/md4.d.ts +2 -0
  175. package/dist/base/hash/md4.js +10 -0
  176. package/dist/base/hash/wasm-hash.d.ts +3 -0
  177. package/dist/base/hash/wasm-hash.js +138 -0
  178. package/dist/base/hash/xxhash64.d.ts +2 -0
  179. package/dist/base/hash/xxhash64.js +10 -0
  180. package/dist/base/identifier.d.ts +30 -0
  181. package/dist/base/identifier.js +237 -0
  182. package/dist/base/logging/Logger.d.ts +40 -0
  183. package/dist/base/logging/Logger.js +128 -0
  184. package/dist/base/logging/createConsoleLogger.d.ts +6 -0
  185. package/dist/base/logging/createConsoleLogger.js +161 -0
  186. package/dist/base/logging/nodeConsole.d.ts +21 -0
  187. package/dist/base/logging/nodeConsole.js +109 -0
  188. package/dist/base/logging/runtime.d.ts +8 -0
  189. package/dist/base/logging/runtime.js +30 -0
  190. package/dist/base/logging/truncateArgs.d.ts +2 -0
  191. package/dist/base/logging/truncateArgs.js +66 -0
  192. package/dist/base/memoize.d.ts +2 -0
  193. package/dist/base/memoize.js +18 -0
  194. package/dist/base/missingModule.d.ts +4 -0
  195. package/dist/base/missingModule.js +16 -0
  196. package/dist/base/moduleAlias.d.ts +1 -0
  197. package/dist/base/moduleAlias.js +8 -0
  198. package/dist/base/nonNumericOnlyHash.d.ts +7 -0
  199. package/dist/base/nonNumericOnlyHash.js +16 -0
  200. package/dist/base/normalization.d.ts +32 -0
  201. package/dist/base/normalization.js +320 -0
  202. package/dist/base/numberHash.d.ts +17 -0
  203. package/dist/base/numberHash.js +72 -0
  204. package/dist/base/objectToMap.d.ts +1 -0
  205. package/dist/base/objectToMap.js +6 -0
  206. package/dist/base/processAsyncTree.d.ts +2 -0
  207. package/dist/base/processAsyncTree.js +45 -0
  208. package/dist/base/propertyAccess.d.ts +2 -0
  209. package/dist/base/propertyAccess.js +20 -0
  210. package/dist/base/propertyName.d.ts +9 -0
  211. package/dist/base/propertyName.js +71 -0
  212. package/dist/base/semver.d.ts +25 -0
  213. package/dist/base/semver.js +425 -0
  214. package/dist/base/singletontask.d.ts +27 -0
  215. package/dist/base/singletontask.js +124 -0
  216. package/dist/base/smartGrouping.d.ts +2 -0
  217. package/dist/base/smartGrouping.js +138 -0
  218. package/dist/base/source.d.ts +2 -0
  219. package/dist/base/source.js +48 -0
  220. package/dist/base/stats/MultiStats.d.ts +19 -0
  221. package/dist/base/stats/MultiStats.js +142 -0
  222. package/dist/base/stats/Stats.d.ts +13 -0
  223. package/dist/base/stats/Stats.js +49 -0
  224. package/dist/base/stats/StatsFactory.d.ts +26 -0
  225. package/dist/base/stats/StatsFactory.js +163 -0
  226. package/dist/base/stats/StatsPrinter.d.ts +12 -0
  227. package/dist/base/stats/StatsPrinter.js +104 -0
  228. package/dist/base/utils.d.ts +5 -0
  229. package/dist/base/utils.js +35 -0
  230. package/dist/cache/AddBuildDependenciesPlugin.d.ts +6 -0
  231. package/dist/cache/AddBuildDependenciesPlugin.js +13 -0
  232. package/dist/cache/AddManagedPathsPlugin.d.ts +7 -0
  233. package/dist/cache/AddManagedPathsPlugin.js +17 -0
  234. package/dist/cache/Cache.d.ts +15 -0
  235. package/dist/cache/Cache.js +69 -0
  236. package/dist/cache/CacheFacade.d.ts +37 -0
  237. package/dist/cache/CacheFacade.js +187 -0
  238. package/dist/cache/IdleFileCachePlugin.d.ts +9 -0
  239. package/dist/cache/IdleFileCachePlugin.js +165 -0
  240. package/dist/cache/MemoryCachePlugin.d.ts +4 -0
  241. package/dist/cache/MemoryCachePlugin.js +36 -0
  242. package/dist/cache/MemoryWithGcCachePlugin.d.ts +8 -0
  243. package/dist/cache/MemoryWithGcCachePlugin.js +104 -0
  244. package/dist/cache/PackFileCacheStrategy.d.ts +47 -0
  245. package/dist/cache/PackFileCacheStrategy.js +1085 -0
  246. package/dist/cache/ResolverCachePlugin.d.ts +4 -0
  247. package/dist/cache/ResolverCachePlugin.js +248 -0
  248. package/dist/cache/getLazyHashedEtag.d.ts +2 -0
  249. package/dist/cache/getLazyHashedEtag.js +53 -0
  250. package/dist/cache/mergeEtags.d.ts +2 -0
  251. package/dist/cache/mergeEtags.js +50 -0
  252. package/dist/chunk/Chunk.d.ts +75 -0
  253. package/dist/chunk/Chunk.js +445 -0
  254. package/dist/chunk/ChunkGraph.d.ts +102 -0
  255. package/dist/chunk/ChunkGraph.js +1037 -0
  256. package/dist/chunk/ChunkGroup.d.ts +62 -0
  257. package/dist/chunk/ChunkGroup.js +341 -0
  258. package/dist/chunk/CodeGenerationResults.d.ts +13 -0
  259. package/dist/chunk/CodeGenerationResults.js +82 -0
  260. package/dist/chunk/Entrypoint.d.ts +22 -0
  261. package/dist/chunk/Entrypoint.js +56 -0
  262. package/dist/chunk/GraphHelpers.d.ts +3 -0
  263. package/dist/chunk/GraphHelpers.js +15 -0
  264. package/dist/chunk/buildChunkGraph.d.ts +2 -0
  265. package/dist/chunk/buildChunkGraph.js +1067 -0
  266. package/dist/chunk/chunkFormat/ArrayPushCallbackChunkFormatPlugin.d.ts +4 -0
  267. package/dist/chunk/chunkFormat/ArrayPushCallbackChunkFormatPlugin.js +101 -0
  268. package/dist/chunk/chunkLoading/JsonpChunkLoadingPlugin.d.ts +4 -0
  269. package/dist/chunk/chunkLoading/JsonpChunkLoadingPlugin.js +98 -0
  270. package/dist/chunk/chunkLoading/JsonpChunkLoadingRuntimeModule.d.ts +15 -0
  271. package/dist/chunk/chunkLoading/JsonpChunkLoadingRuntimeModule.js +272 -0
  272. package/dist/dependencies/AsyncDependenciesBlock.d.ts +14 -0
  273. package/dist/dependencies/AsyncDependenciesBlock.js +64 -0
  274. package/dist/dependencies/CreateScriptUrlDependency.d.ts +9 -0
  275. package/dist/dependencies/CreateScriptUrlDependency.js +60 -0
  276. package/dist/dependencies/DelegatedSourceDependency.d.ts +7 -0
  277. package/dist/dependencies/DelegatedSourceDependency.js +20 -0
  278. package/dist/dependencies/DependenciesBlock.d.ts +29 -0
  279. package/dist/dependencies/DependenciesBlock.js +66 -0
  280. package/dist/dependencies/Dependency.d.ts +44 -0
  281. package/dist/dependencies/Dependency.js +171 -0
  282. package/dist/dependencies/DependencyTemplate.d.ts +4 -0
  283. package/dist/dependencies/DependencyTemplate.js +9 -0
  284. package/dist/dependencies/DependencyTemplates.d.ts +12 -0
  285. package/dist/dependencies/DependencyTemplates.js +34 -0
  286. package/dist/dependencies/DynamicExports.d.ts +6 -0
  287. package/dist/dependencies/DynamicExports.js +48 -0
  288. package/dist/dependencies/ExportsInfoDependency.d.ts +10 -0
  289. package/dist/dependencies/ExportsInfoDependency.js +80 -0
  290. package/dist/dependencies/LocalModule.d.ts +11 -0
  291. package/dist/dependencies/LocalModule.js +33 -0
  292. package/dist/dependencies/LocalModuleDependency.d.ts +10 -0
  293. package/dist/dependencies/LocalModuleDependency.js +42 -0
  294. package/dist/dependencies/LocalModulesHelpers.d.ts +4 -0
  295. package/dist/dependencies/LocalModulesHelpers.js +48 -0
  296. package/dist/dependencies/ModuleDecoratorDependency.d.ts +15 -0
  297. package/dist/dependencies/ModuleDecoratorDependency.js +85 -0
  298. package/dist/dependencies/ModuleDependency.d.ts +16 -0
  299. package/dist/dependencies/ModuleDependency.js +53 -0
  300. package/dist/dependencies/ModuleDependencyTemplateAsId.d.ts +9 -0
  301. package/dist/dependencies/ModuleDependencyTemplateAsId.js +21 -0
  302. package/dist/dependencies/ModuleDependencyTemplateAsRequireId.d.ts +10 -0
  303. package/dist/dependencies/ModuleDependencyTemplateAsRequireId.js +22 -0
  304. package/dist/dependencies/NullDependency.d.ts +7 -0
  305. package/dist/dependencies/NullDependency.js +19 -0
  306. package/dist/dependencies/PureExpressionDependency.d.ts +12 -0
  307. package/dist/dependencies/PureExpressionDependency.js +73 -0
  308. package/dist/dependencies/RequireHeaderDependency.d.ts +8 -0
  309. package/dist/dependencies/RequireHeaderDependency.js +58 -0
  310. package/dist/dependencies/RequireResolveContextDependency.d.ts +8 -0
  311. package/dist/dependencies/RequireResolveContextDependency.js +33 -0
  312. package/dist/dependencies/RequireResolveDependency.d.ts +10 -0
  313. package/dist/dependencies/RequireResolveDependency.js +29 -0
  314. package/dist/dependencies/RequireResolveHeaderDependency.d.ts +8 -0
  315. package/dist/dependencies/RequireResolveHeaderDependency.js +36 -0
  316. package/dist/dependencies/RuntimeRequirementsDependency.d.ts +10 -0
  317. package/dist/dependencies/RuntimeRequirementsDependency.js +40 -0
  318. package/dist/dependencies/StaticExportsDependency.d.ts +15 -0
  319. package/dist/dependencies/StaticExportsDependency.js +38 -0
  320. package/dist/dependencies/URLDependency.d.ts +16 -0
  321. package/dist/dependencies/URLDependency.js +103 -0
  322. package/dist/dependencies/URLPlugin.d.ts +4 -0
  323. package/dist/dependencies/URLPlugin.js +107 -0
  324. package/dist/dependencies/UnsupportedDependency.d.ts +9 -0
  325. package/dist/dependencies/UnsupportedDependency.js +36 -0
  326. package/dist/dependencies/commonjs/CommonJsDependencyHelpers.d.ts +2 -0
  327. package/dist/dependencies/commonjs/CommonJsDependencyHelpers.js +67 -0
  328. package/dist/dependencies/commonjs/CommonJsExportRequireDependency.d.ts +46 -0
  329. package/dist/dependencies/commonjs/CommonJsExportRequireDependency.js +260 -0
  330. package/dist/dependencies/commonjs/CommonJsExportsDependency.d.ts +19 -0
  331. package/dist/dependencies/commonjs/CommonJsExportsDependency.js +82 -0
  332. package/dist/dependencies/commonjs/CommonJsExportsParserPlugin.d.ts +6 -0
  333. package/dist/dependencies/commonjs/CommonJsExportsParserPlugin.js +314 -0
  334. package/dist/dependencies/commonjs/CommonJsFullRequireDependency.d.ts +13 -0
  335. package/dist/dependencies/commonjs/CommonJsFullRequireDependency.js +77 -0
  336. package/dist/dependencies/commonjs/CommonJsImportsParserPlugin.d.ts +6 -0
  337. package/dist/dependencies/commonjs/CommonJsImportsParserPlugin.js +500 -0
  338. package/dist/dependencies/commonjs/CommonJsPlugin.d.ts +4 -0
  339. package/dist/dependencies/commonjs/CommonJsPlugin.js +170 -0
  340. package/dist/dependencies/commonjs/CommonJsRequireContextDependency.d.ts +8 -0
  341. package/dist/dependencies/commonjs/CommonJsRequireContextDependency.js +37 -0
  342. package/dist/dependencies/commonjs/CommonJsRequireDependency.d.ts +7 -0
  343. package/dist/dependencies/commonjs/CommonJsRequireDependency.js +24 -0
  344. package/dist/dependencies/commonjs/CommonJsSelfReferenceDependency.d.ts +15 -0
  345. package/dist/dependencies/commonjs/CommonJsSelfReferenceDependency.js +112 -0
  346. package/dist/dependencies/const/CachedConstDependency.d.ts +12 -0
  347. package/dist/dependencies/const/CachedConstDependency.js +50 -0
  348. package/dist/dependencies/const/ConstDependency.d.ts +13 -0
  349. package/dist/dependencies/const/ConstDependency.js +63 -0
  350. package/dist/dependencies/context/ContextDependency.d.ts +26 -0
  351. package/dist/dependencies/context/ContextDependency.js +91 -0
  352. package/dist/dependencies/context/ContextDependencyHelpers.d.ts +2 -0
  353. package/dist/dependencies/context/ContextDependencyHelpers.js +128 -0
  354. package/dist/dependencies/context/ContextDependencyTemplateAsId.d.ts +10 -0
  355. package/dist/dependencies/context/ContextDependencyTemplateAsId.js +37 -0
  356. package/dist/dependencies/context/ContextDependencyTemplateAsRequireCall.d.ts +10 -0
  357. package/dist/dependencies/context/ContextDependencyTemplateAsRequireCall.js +39 -0
  358. package/dist/dependencies/context/ContextElementDependency.d.ts +13 -0
  359. package/dist/dependencies/context/ContextElementDependency.js +53 -0
  360. package/dist/dependencies/css/CssExportDependency.d.ts +17 -0
  361. package/dist/dependencies/css/CssExportDependency.js +49 -0
  362. package/dist/dependencies/css/CssImportDependency.d.ts +14 -0
  363. package/dist/dependencies/css/CssImportDependency.js +60 -0
  364. package/dist/dependencies/css/CssLocalIdentifierDependency.d.ts +12 -0
  365. package/dist/dependencies/css/CssLocalIdentifierDependency.js +69 -0
  366. package/dist/dependencies/css/CssSelfLocalIdentifierDependency.d.ts +13 -0
  367. package/dist/dependencies/css/CssSelfLocalIdentifierDependency.js +53 -0
  368. package/dist/dependencies/css/CssUrlDependency.d.ts +12 -0
  369. package/dist/dependencies/css/CssUrlDependency.js +89 -0
  370. package/dist/dependencies/entry/DynamicEntryPlugin.d.ts +22 -0
  371. package/dist/dependencies/entry/DynamicEntryPlugin.js +62 -0
  372. package/dist/dependencies/entry/EntryDependency.d.ts +7 -0
  373. package/dist/dependencies/entry/EntryDependency.js +20 -0
  374. package/dist/dependencies/getFunctionExpression.d.ts +10 -0
  375. package/dist/dependencies/getFunctionExpression.js +42 -0
  376. package/dist/dependencies/harmony/HarmonyAcceptDependency.d.ts +11 -0
  377. package/dist/dependencies/harmony/HarmonyAcceptDependency.js +81 -0
  378. package/dist/dependencies/harmony/HarmonyAcceptImportDependency.d.ts +6 -0
  379. package/dist/dependencies/harmony/HarmonyAcceptImportDependency.js +20 -0
  380. package/dist/dependencies/harmony/HarmonyCompatibilityDependency.d.ts +5 -0
  381. package/dist/dependencies/harmony/HarmonyCompatibilityDependency.js +61 -0
  382. package/dist/dependencies/harmony/HarmonyDetectionParserPlugin.d.ts +5 -0
  383. package/dist/dependencies/harmony/HarmonyDetectionParserPlugin.js +102 -0
  384. package/dist/dependencies/harmony/HarmonyEvaluatedImportSpecifierDependency.d.ts +16 -0
  385. package/dist/dependencies/harmony/HarmonyEvaluatedImportSpecifierDependency.js +84 -0
  386. package/dist/dependencies/harmony/HarmonyExportDependencyParserPlugin.d.ts +5 -0
  387. package/dist/dependencies/harmony/HarmonyExportDependencyParserPlugin.js +143 -0
  388. package/dist/dependencies/harmony/HarmonyExportExpressionDependency.d.ts +23 -0
  389. package/dist/dependencies/harmony/HarmonyExportExpressionDependency.js +148 -0
  390. package/dist/dependencies/harmony/HarmonyExportHeaderDependency.d.ts +10 -0
  391. package/dist/dependencies/harmony/HarmonyExportHeaderDependency.js +39 -0
  392. package/dist/dependencies/harmony/HarmonyExportImportedSpecifierDependency.d.ts +140 -0
  393. package/dist/dependencies/harmony/HarmonyExportImportedSpecifierDependency.js +763 -0
  394. package/dist/dependencies/harmony/HarmonyExportInitFragment.d.ts +14 -0
  395. package/dist/dependencies/harmony/HarmonyExportInitFragment.js +147 -0
  396. package/dist/dependencies/harmony/HarmonyExportSpecifierDependency.d.ts +17 -0
  397. package/dist/dependencies/harmony/HarmonyExportSpecifierDependency.js +62 -0
  398. package/dist/dependencies/harmony/HarmonyExports.d.ts +3 -0
  399. package/dist/dependencies/harmony/HarmonyExports.js +51 -0
  400. package/dist/dependencies/harmony/HarmonyImportDependency.d.ts +30 -0
  401. package/dist/dependencies/harmony/HarmonyImportDependency.js +217 -0
  402. package/dist/dependencies/harmony/HarmonyImportDependencyParserPlugin.d.ts +9 -0
  403. package/dist/dependencies/harmony/HarmonyImportDependencyParserPlugin.js +202 -0
  404. package/dist/dependencies/harmony/HarmonyImportSideEffectDependency.d.ts +8 -0
  405. package/dist/dependencies/harmony/HarmonyImportSideEffectDependency.js +43 -0
  406. package/dist/dependencies/harmony/HarmonyImportSpecifierDependency.d.ts +33 -0
  407. package/dist/dependencies/harmony/HarmonyImportSpecifierDependency.js +272 -0
  408. package/dist/dependencies/harmony/HarmonyModulesPlugin.d.ts +6 -0
  409. package/dist/dependencies/harmony/HarmonyModulesPlugin.js +57 -0
  410. package/dist/dependencies/harmony/HarmonyTopLevelThisParserPlugin.d.ts +4 -0
  411. package/dist/dependencies/harmony/HarmonyTopLevelThisParserPlugin.js +45 -0
  412. package/dist/dependencies/import/ImportContextDependency.d.ts +9 -0
  413. package/dist/dependencies/import/ImportContextDependency.js +34 -0
  414. package/dist/dependencies/import/ImportDependency.d.ts +11 -0
  415. package/dist/dependencies/import/ImportDependency.js +57 -0
  416. package/dist/dependencies/import/ImportEagerDependency.d.ts +7 -0
  417. package/dist/dependencies/import/ImportEagerDependency.js +34 -0
  418. package/dist/dependencies/import/ImportMetaContextDependency.d.ts +7 -0
  419. package/dist/dependencies/import/ImportMetaContextDependency.js +23 -0
  420. package/dist/dependencies/import/ImportMetaContextDependencyParserPlugin.d.ts +3 -0
  421. package/dist/dependencies/import/ImportMetaContextDependencyParserPlugin.js +207 -0
  422. package/dist/dependencies/import/ImportMetaContextPlugin.d.ts +4 -0
  423. package/dist/dependencies/import/ImportMetaContextPlugin.js +27 -0
  424. package/dist/dependencies/import/ImportMetaHotAcceptDependency.d.ts +7 -0
  425. package/dist/dependencies/import/ImportMetaHotAcceptDependency.js +24 -0
  426. package/dist/dependencies/import/ImportMetaHotDeclineDependency.d.ts +7 -0
  427. package/dist/dependencies/import/ImportMetaHotDeclineDependency.js +24 -0
  428. package/dist/dependencies/import/ImportMetaPlugin.d.ts +4 -0
  429. package/dist/dependencies/import/ImportMetaPlugin.js +129 -0
  430. package/dist/dependencies/import/ImportParserPlugin.d.ts +6 -0
  431. package/dist/dependencies/import/ImportParserPlugin.js +207 -0
  432. package/dist/dependencies/import/ImportPlugin.d.ts +4 -0
  433. package/dist/dependencies/import/ImportPlugin.js +37 -0
  434. package/dist/dependencies/import/ImportWeakDependency.d.ts +6 -0
  435. package/dist/dependencies/import/ImportWeakDependency.js +33 -0
  436. package/dist/dependencies/json/JsonExportsDependency.d.ts +14 -0
  437. package/dist/dependencies/json/JsonExportsDependency.js +61 -0
  438. package/dist/dependencies/loader/LoaderDependency.d.ts +8 -0
  439. package/dist/dependencies/loader/LoaderDependency.js +21 -0
  440. package/dist/dependencies/loader/LoaderImportDependency.d.ts +8 -0
  441. package/dist/dependencies/loader/LoaderImportDependency.js +22 -0
  442. package/dist/dependencies/loader/LoaderPlugin.d.ts +5 -0
  443. package/dist/dependencies/loader/LoaderPlugin.js +164 -0
  444. package/dist/dependencies/processExportInfo.d.ts +2 -0
  445. package/dist/dependencies/processExportInfo.js +32 -0
  446. package/dist/ids/DeterministicChunkIdsPlugin.d.ts +10 -0
  447. package/dist/ids/DeterministicChunkIdsPlugin.js +30 -0
  448. package/dist/ids/DeterministicModuleIdsPlugin.d.ts +6 -0
  449. package/dist/ids/DeterministicModuleIdsPlugin.js +38 -0
  450. package/dist/ids/IdHelpers.d.ts +16 -0
  451. package/dist/ids/IdHelpers.js +259 -0
  452. package/dist/ids/NamedChunkIdsPlugin.d.ts +11 -0
  453. package/dist/ids/NamedChunkIdsPlugin.js +34 -0
  454. package/dist/ids/NamedModuleIdsPlugin.d.ts +6 -0
  455. package/dist/ids/NamedModuleIdsPlugin.js +25 -0
  456. package/dist/ids/NaturalChunkIdsPlugin.d.ts +4 -0
  457. package/dist/ids/NaturalChunkIdsPlugin.js +17 -0
  458. package/dist/ids/NaturalModuleIdsPlugin.d.ts +4 -0
  459. package/dist/ids/NaturalModuleIdsPlugin.js +16 -0
  460. package/dist/index.d.ts +23 -0
  461. package/dist/index.js +58 -0
  462. package/dist/library/AbstractLibraryPlugin.d.ts +21 -0
  463. package/dist/library/AbstractLibraryPlugin.js +177 -0
  464. package/dist/library/AssignLibraryPlugin.d.ts +53 -0
  465. package/dist/library/AssignLibraryPlugin.js +201 -0
  466. package/dist/library/EnableLibraryPlugin.d.ts +8 -0
  467. package/dist/library/EnableLibraryPlugin.js +174 -0
  468. package/dist/library/ExportPropertyLibraryPlugin.d.ts +22 -0
  469. package/dist/library/ExportPropertyLibraryPlugin.js +74 -0
  470. package/dist/library/JsonpLibraryPlugin.d.ts +19 -0
  471. package/dist/library/JsonpLibraryPlugin.js +35 -0
  472. package/dist/library/ModuleLibraryPlugin.d.ts +16 -0
  473. package/dist/library/ModuleLibraryPlugin.js +73 -0
  474. package/dist/library/UmdLibraryPlugin.d.ts +22 -0
  475. package/dist/library/UmdLibraryPlugin.js +161 -0
  476. package/dist/module/ContextExclusionPlugin.d.ts +6 -0
  477. package/dist/module/ContextExclusionPlugin.js +13 -0
  478. package/dist/module/ContextModule.d.ts +75 -0
  479. package/dist/module/ContextModule.js +844 -0
  480. package/dist/module/ContextModuleFactory.d.ts +8 -0
  481. package/dist/module/ContextModuleFactory.js +292 -0
  482. package/dist/module/ContextReplacementPlugin.d.ts +11 -0
  483. package/dist/module/ContextReplacementPlugin.js +128 -0
  484. package/dist/module/CssModule.d.ts +20 -0
  485. package/dist/module/CssModule.js +105 -0
  486. package/dist/module/ExportsInfo.d.ts +135 -0
  487. package/dist/module/ExportsInfo.js +1171 -0
  488. package/dist/module/ExportsInfoApiPlugin.d.ts +4 -0
  489. package/dist/module/ExportsInfoApiPlugin.js +38 -0
  490. package/dist/module/ExternalModule.d.ts +47 -0
  491. package/dist/module/ExternalModule.js +458 -0
  492. package/dist/module/ExternalModuleFactoryPlugin.d.ts +7 -0
  493. package/dist/module/ExternalModuleFactoryPlugin.js +176 -0
  494. package/dist/module/ExternalsPlugin.d.ts +7 -0
  495. package/dist/module/ExternalsPlugin.js +18 -0
  496. package/dist/module/Generator.d.ts +40 -0
  497. package/dist/module/Generator.js +49 -0
  498. package/dist/module/IgnoreErrorModuleFactory.d.ts +7 -0
  499. package/dist/module/IgnoreErrorModuleFactory.js +16 -0
  500. package/dist/module/JavascriptMetaInfoPlugin.d.ts +4 -0
  501. package/dist/module/JavascriptMetaInfoPlugin.js +65 -0
  502. package/dist/module/LazyModuleFactoryPlugin.d.ts +6 -0
  503. package/dist/module/LazyModuleFactoryPlugin.js +171 -0
  504. package/dist/module/Module.d.ts +175 -0
  505. package/dist/module/Module.js +550 -0
  506. package/dist/module/ModuleFactory.d.ts +25 -0
  507. package/dist/module/ModuleFactory.js +10 -0
  508. package/dist/module/ModuleGraph.d.ts +74 -0
  509. package/dist/module/ModuleGraph.js +470 -0
  510. package/dist/module/ModuleGraphConnection.d.ts +33 -0
  511. package/dist/module/ModuleGraphConnection.js +113 -0
  512. package/dist/module/ModuleProfile.d.ts +40 -0
  513. package/dist/module/ModuleProfile.js +77 -0
  514. package/dist/module/ModuleTypeConstants.d.ts +22 -0
  515. package/dist/module/ModuleTypeConstants.js +45 -0
  516. package/dist/module/NormalModule.d.ts +104 -0
  517. package/dist/module/NormalModule.js +904 -0
  518. package/dist/module/NormalModuleFactory.d.ts +36 -0
  519. package/dist/module/NormalModuleFactory.js +761 -0
  520. package/dist/module/Parser.d.ts +4 -0
  521. package/dist/module/Parser.js +9 -0
  522. package/dist/module/RawModule.d.ts +29 -0
  523. package/dist/module/RawModule.js +74 -0
  524. package/dist/module/RuntimeGlobals.d.ts +310 -0
  525. package/dist/module/RuntimeGlobals.js +316 -0
  526. package/dist/module/RuntimeHelpers.d.ts +43 -0
  527. package/dist/module/RuntimeHelpers.js +548 -0
  528. package/dist/module/RuntimeModule.d.ts +39 -0
  529. package/dist/module/RuntimeModule.js +114 -0
  530. package/dist/module/RuntimePlugin.d.ts +4 -0
  531. package/dist/module/RuntimePlugin.js +332 -0
  532. package/dist/module/SelfModuleFactory.d.ts +6 -0
  533. package/dist/module/SelfModuleFactory.js +14 -0
  534. package/dist/module/asset/AssetGenerator.d.ts +30 -0
  535. package/dist/module/asset/AssetGenerator.js +364 -0
  536. package/dist/module/asset/AssetModulesPlugin.d.ts +4 -0
  537. package/dist/module/asset/AssetModulesPlugin.js +98 -0
  538. package/dist/module/asset/AssetParser.d.ts +12 -0
  539. package/dist/module/asset/AssetParser.js +44 -0
  540. package/dist/module/asset/AssetSourceGenerator.d.ts +14 -0
  541. package/dist/module/asset/AssetSourceGenerator.js +74 -0
  542. package/dist/module/asset/AssetSourceParser.d.ts +5 -0
  543. package/dist/module/asset/AssetSourceParser.js +19 -0
  544. package/dist/module/asset/RawDataUrlModule.d.ts +27 -0
  545. package/dist/module/asset/RawDataUrlModule.js +102 -0
  546. package/dist/module/async-modules/AwaitDependenciesInitFragment.d.ts +10 -0
  547. package/dist/module/async-modules/AwaitDependenciesInitFragment.js +68 -0
  548. package/dist/module/async-modules/InferAsyncModulesPlugin.d.ts +4 -0
  549. package/dist/module/async-modules/InferAsyncModulesPlugin.js +28 -0
  550. package/dist/module/javascript/BasicEvaluatedExpression.d.ts +139 -0
  551. package/dist/module/javascript/BasicEvaluatedExpression.js +481 -0
  552. package/dist/module/javascript/JavascriptGenerator.d.ts +11 -0
  553. package/dist/module/javascript/JavascriptGenerator.js +103 -0
  554. package/dist/module/javascript/JavascriptModulesPlugin.d.ts +17 -0
  555. package/dist/module/javascript/JavascriptModulesPlugin.js +821 -0
  556. package/dist/module/javascript/JavascriptParser.d.ts +598 -0
  557. package/dist/module/javascript/JavascriptParser.js +3579 -0
  558. package/dist/module/javascript/JavascriptParserHelpers.d.ts +10 -0
  559. package/dist/module/javascript/JavascriptParserHelpers.js +61 -0
  560. package/dist/module/json/JsonData.d.ts +9 -0
  561. package/dist/module/json/JsonData.js +43 -0
  562. package/dist/module/json/JsonGenerator.d.ts +15 -0
  563. package/dist/module/json/JsonGenerator.js +137 -0
  564. package/dist/module/json/JsonModulesPlugin.d.ts +4 -0
  565. package/dist/module/json/JsonModulesPlugin.js +20 -0
  566. package/dist/module/json/JsonParser.d.ts +7 -0
  567. package/dist/module/json/JsonParser.js +41 -0
  568. package/dist/module/runtime/AsyncModuleRuntimeModule.d.ts +6 -0
  569. package/dist/module/runtime/AsyncModuleRuntimeModule.js +115 -0
  570. package/dist/module/runtime/AutoPublicPathRuntimeModule.d.ts +6 -0
  571. package/dist/module/runtime/AutoPublicPathRuntimeModule.js +81 -0
  572. package/dist/module/runtime/BaseUriRuntimeModule.d.ts +6 -0
  573. package/dist/module/runtime/BaseUriRuntimeModule.js +41 -0
  574. package/dist/module/runtime/ChunkNameRuntimeModule.d.ts +7 -0
  575. package/dist/module/runtime/ChunkNameRuntimeModule.js +40 -0
  576. package/dist/module/runtime/CompatGetDefaultExportRuntimeModule.d.ts +6 -0
  577. package/dist/module/runtime/CompatGetDefaultExportRuntimeModule.js +54 -0
  578. package/dist/module/runtime/CompatRuntimeModule.d.ts +7 -0
  579. package/dist/module/runtime/CompatRuntimeModule.js +59 -0
  580. package/dist/module/runtime/CreateFakeNamespaceObjectRuntimeModule.d.ts +6 -0
  581. package/dist/module/runtime/CreateFakeNamespaceObjectRuntimeModule.js +77 -0
  582. package/dist/module/runtime/CreateScriptRuntimeModule.d.ts +6 -0
  583. package/dist/module/runtime/CreateScriptRuntimeModule.js +44 -0
  584. package/dist/module/runtime/CreateScriptUrlRuntimeModule.d.ts +6 -0
  585. package/dist/module/runtime/CreateScriptUrlRuntimeModule.js +44 -0
  586. package/dist/module/runtime/DefinePropertyGettersRuntimeModule.d.ts +6 -0
  587. package/dist/module/runtime/DefinePropertyGettersRuntimeModule.js +56 -0
  588. package/dist/module/runtime/EnsureChunkRuntimeModule.d.ts +7 -0
  589. package/dist/module/runtime/EnsureChunkRuntimeModule.js +66 -0
  590. package/dist/module/runtime/GetChunkFilenameRuntimeModule.d.ts +10 -0
  591. package/dist/module/runtime/GetChunkFilenameRuntimeModule.js +220 -0
  592. package/dist/module/runtime/GetFullHashRuntimeModule.d.ts +6 -0
  593. package/dist/module/runtime/GetFullHashRuntimeModule.js +42 -0
  594. package/dist/module/runtime/GetMainFilenameRuntimeModule.d.ts +8 -0
  595. package/dist/module/runtime/GetMainFilenameRuntimeModule.js +52 -0
  596. package/dist/module/runtime/GetTrustedTypesPolicyRuntimeModule.d.ts +7 -0
  597. package/dist/module/runtime/GetTrustedTypesPolicyRuntimeModule.js +89 -0
  598. package/dist/module/runtime/GlobalRuntimeModule.d.ts +6 -0
  599. package/dist/module/runtime/GlobalRuntimeModule.js +61 -0
  600. package/dist/module/runtime/HasOwnPropertyRuntimeModule.d.ts +6 -0
  601. package/dist/module/runtime/HasOwnPropertyRuntimeModule.js +44 -0
  602. package/dist/module/runtime/HelperRuntimeModule.d.ts +5 -0
  603. package/dist/module/runtime/HelperRuntimeModule.js +12 -0
  604. package/dist/module/runtime/LoadScriptRuntimeModule.d.ts +9 -0
  605. package/dist/module/runtime/LoadScriptRuntimeModule.js +129 -0
  606. package/dist/module/runtime/MakeNamespaceObjectRuntimeModule.d.ts +6 -0
  607. package/dist/module/runtime/MakeNamespaceObjectRuntimeModule.js +53 -0
  608. package/dist/module/runtime/NonceRuntimeModule.d.ts +6 -0
  609. package/dist/module/runtime/NonceRuntimeModule.js +39 -0
  610. package/dist/module/runtime/OnChunksLoadedRuntimeModule.d.ts +6 -0
  611. package/dist/module/runtime/OnChunksLoadedRuntimeModule.js +81 -0
  612. package/dist/module/runtime/PublicPathRuntimeModule.d.ts +7 -0
  613. package/dist/module/runtime/PublicPathRuntimeModule.js +44 -0
  614. package/dist/module/runtime/RelativeUrlRuntimeModule.d.ts +6 -0
  615. package/dist/module/runtime/RelativeUrlRuntimeModule.js +56 -0
  616. package/dist/module/runtime/RuntimeIdRuntimeModule.d.ts +6 -0
  617. package/dist/module/runtime/RuntimeIdRuntimeModule.js +45 -0
  618. package/dist/module/runtime/StartupChunkDependenciesPlugin.d.ts +11 -0
  619. package/dist/module/runtime/StartupChunkDependenciesPlugin.js +69 -0
  620. package/dist/module/runtime/StartupChunkDependenciesRuntimeModule.d.ts +7 -0
  621. package/dist/module/runtime/StartupChunkDependenciesRuntimeModule.js +67 -0
  622. package/dist/module/runtime/StartupEntrypointRuntimeModule.d.ts +7 -0
  623. package/dist/module/runtime/StartupEntrypointRuntimeModule.js +58 -0
  624. package/dist/module/uri/DataUriPlugin.d.ts +4 -0
  625. package/dist/module/uri/DataUriPlugin.js +46 -0
  626. package/dist/module/uri/FileUriPlugin.d.ts +4 -0
  627. package/dist/module/uri/FileUriPlugin.js +31 -0
  628. package/dist/plugins/APIPlugin.d.ts +9 -0
  629. package/dist/plugins/APIPlugin.js +230 -0
  630. package/dist/plugins/CleanPlugin.d.ts +7 -0
  631. package/dist/plugins/CleanPlugin.js +295 -0
  632. package/dist/plugins/CompatibilityPlugin.d.ts +4 -0
  633. package/dist/plugins/CompatibilityPlugin.js +142 -0
  634. package/dist/plugins/ConstPlugin.d.ts +4 -0
  635. package/dist/plugins/ConstPlugin.js +409 -0
  636. package/dist/plugins/DefaultStatsFactoryPlugin.d.ts +4 -0
  637. package/dist/plugins/DefaultStatsFactoryPlugin.js +1552 -0
  638. package/dist/plugins/DefaultStatsPresetPlugin.d.ts +4 -0
  639. package/dist/plugins/DefaultStatsPresetPlugin.js +306 -0
  640. package/dist/plugins/DefaultStatsPrinterPlugin.d.ts +4 -0
  641. package/dist/plugins/DefaultStatsPrinterPlugin.js +986 -0
  642. package/dist/plugins/DefinePlugin.d.ts +15 -0
  643. package/dist/plugins/DefinePlugin.js +400 -0
  644. package/dist/plugins/NodeStuffPlugin.d.ts +6 -0
  645. package/dist/plugins/NodeStuffPlugin.js +134 -0
  646. package/dist/plugins/ProgressPlugin.d.ts +20 -0
  647. package/dist/plugins/ProgressPlugin.js +494 -0
  648. package/dist/plugins/RecordIdsPlugin.d.ts +9 -0
  649. package/dist/plugins/RecordIdsPlugin.js +175 -0
  650. package/dist/plugins/UseStrictPlugin.d.ts +4 -0
  651. package/dist/plugins/UseStrictPlugin.js +35 -0
  652. package/dist/plugins/WarnCaseSensitiveModulesPlugin.d.ts +4 -0
  653. package/dist/plugins/WarnCaseSensitiveModulesPlugin.js +37 -0
  654. package/dist/plugins/WarnDeprecatedOptionPlugin.d.ts +8 -0
  655. package/dist/plugins/WarnDeprecatedOptionPlugin.js +29 -0
  656. package/dist/plugins/cssMinimizer/CssMinimizerMinify.js +73 -0
  657. package/dist/plugins/cssMinimizer/CssMinimizerPlugin.d.ts +11 -0
  658. package/dist/plugins/cssMinimizer/CssMinimizerPlugin.js +329 -0
  659. package/dist/plugins/cssMinimizer/CssMinimizerUtils.js +147 -0
  660. package/dist/plugins/miniCssExtractPlugin/MiniCssExtractLoader.d.ts +1 -0
  661. package/dist/plugins/miniCssExtractPlugin/MiniCssExtractLoader.js +177 -0
  662. package/dist/plugins/miniCssExtractPlugin/MiniCssExtractPlugin.d.ts +22 -0
  663. package/dist/plugins/miniCssExtractPlugin/MiniCssExtractPlugin.js +780 -0
  664. package/dist/plugins/miniCssExtractPlugin/MiniCssUtils.d.ts +14 -0
  665. package/dist/plugins/miniCssExtractPlugin/MiniCssUtils.js +132 -0
  666. package/dist/plugins/optimize/AggressiveMergingPlugin.d.ts +6 -0
  667. package/dist/plugins/optimize/AggressiveMergingPlugin.js +62 -0
  668. package/dist/plugins/optimize/AggressiveSplittingPlugin.d.ts +7 -0
  669. package/dist/plugins/optimize/AggressiveSplittingPlugin.js +247 -0
  670. package/dist/plugins/optimize/ConcatenatedModule.d.ts +47 -0
  671. package/dist/plugins/optimize/ConcatenatedModule.js +1221 -0
  672. package/dist/plugins/optimize/EnsureChunkConditionsPlugin.d.ts +4 -0
  673. package/dist/plugins/optimize/EnsureChunkConditionsPlugin.js +61 -0
  674. package/dist/plugins/optimize/FlagAllModulesAsUsedPlugin.d.ts +6 -0
  675. package/dist/plugins/optimize/FlagAllModulesAsUsedPlugin.js +30 -0
  676. package/dist/plugins/optimize/FlagDependencyExportsPlugin.d.ts +4 -0
  677. package/dist/plugins/optimize/FlagDependencyExportsPlugin.js +275 -0
  678. package/dist/plugins/optimize/FlagDependencyUsagePlugin.d.ts +6 -0
  679. package/dist/plugins/optimize/FlagDependencyUsagePlugin.js +243 -0
  680. package/dist/plugins/optimize/FlagEntryExportAsUsedPlugin.d.ts +7 -0
  681. package/dist/plugins/optimize/FlagEntryExportAsUsedPlugin.js +34 -0
  682. package/dist/plugins/optimize/FlagIncludedChunksPlugin.d.ts +4 -0
  683. package/dist/plugins/optimize/FlagIncludedChunksPlugin.js +85 -0
  684. package/dist/plugins/optimize/InnerGraph.d.ts +20 -0
  685. package/dist/plugins/optimize/InnerGraph.js +234 -0
  686. package/dist/plugins/optimize/InnerGraphPlugin.d.ts +4 -0
  687. package/dist/plugins/optimize/InnerGraphPlugin.js +289 -0
  688. package/dist/plugins/optimize/LimitChunkCountPlugin.d.ts +6 -0
  689. package/dist/plugins/optimize/LimitChunkCountPlugin.js +200 -0
  690. package/dist/plugins/optimize/MangleExportsPlugin.d.ts +6 -0
  691. package/dist/plugins/optimize/MangleExportsPlugin.js +124 -0
  692. package/dist/plugins/optimize/MergeDuplicateChunksPlugin.d.ts +4 -0
  693. package/dist/plugins/optimize/MergeDuplicateChunksPlugin.js +84 -0
  694. package/dist/plugins/optimize/MinChunkSizePlugin.d.ts +6 -0
  695. package/dist/plugins/optimize/MinChunkSizePlugin.js +71 -0
  696. package/dist/plugins/optimize/ModuleConcatenationPlugin.d.ts +8 -0
  697. package/dist/plugins/optimize/ModuleConcatenationPlugin.js +525 -0
  698. package/dist/plugins/optimize/ModuleInfoHeaderPlugin.d.ts +6 -0
  699. package/dist/plugins/optimize/ModuleInfoHeaderPlugin.js +145 -0
  700. package/dist/plugins/optimize/NoEmitOnErrorsPlugin.d.ts +4 -0
  701. package/dist/plugins/optimize/NoEmitOnErrorsPlugin.js +17 -0
  702. package/dist/plugins/optimize/OptimizationStages.d.ts +4 -0
  703. package/dist/plugins/optimize/OptimizationStages.js +9 -0
  704. package/dist/plugins/optimize/RealContentHashPlugin.d.ts +11 -0
  705. package/dist/plugins/optimize/RealContentHashPlugin.js +295 -0
  706. package/dist/plugins/optimize/RemoveEmptyChunksPlugin.d.ts +4 -0
  707. package/dist/plugins/optimize/RemoveEmptyChunksPlugin.js +30 -0
  708. package/dist/plugins/optimize/RemoveParentModulesPlugin.d.ts +4 -0
  709. package/dist/plugins/optimize/RemoveParentModulesPlugin.js +103 -0
  710. package/dist/plugins/optimize/RuntimeChunkPlugin.d.ts +6 -0
  711. package/dist/plugins/optimize/RuntimeChunkPlugin.js +25 -0
  712. package/dist/plugins/optimize/SideEffectsFlagPlugin.d.ts +7 -0
  713. package/dist/plugins/optimize/SideEffectsFlagPlugin.js +211 -0
  714. package/dist/plugins/optimize/SplitChunksPlugin.d.ts +7 -0
  715. package/dist/plugins/optimize/SplitChunksPlugin.js +1113 -0
  716. package/dist/rules/BasicEffectRulePlugin.d.ts +7 -0
  717. package/dist/rules/BasicEffectRulePlugin.js +21 -0
  718. package/dist/rules/BasicMatcherRulePlugin.d.ts +8 -0
  719. package/dist/rules/BasicMatcherRulePlugin.js +25 -0
  720. package/dist/rules/ObjectMatcherRulePlugin.d.ts +7 -0
  721. package/dist/rules/ObjectMatcherRulePlugin.js +27 -0
  722. package/dist/rules/RuleSetCompiler.d.ts +20 -0
  723. package/dist/rules/RuleSetCompiler.js +242 -0
  724. package/dist/rules/UseEffectRulePlugin.d.ts +5 -0
  725. package/dist/rules/UseEffectRulePlugin.js +117 -0
  726. package/dist/serialization/Serialization.d.ts +11 -0
  727. package/dist/serialization/Serialization.js +95 -0
  728. package/dist/serialization/Serializer.d.ts +9 -0
  729. package/dist/serialization/Serializer.js +43 -0
  730. package/dist/serialization/SerializerMiddleware.d.ts +13 -0
  731. package/dist/serialization/SerializerMiddleware.js +86 -0
  732. package/dist/serialization/internalSerializables.d.ts +82 -0
  733. package/dist/serialization/internalSerializables.js +94 -0
  734. package/dist/serialization/makeSerializable.d.ts +2 -0
  735. package/dist/serialization/makeSerializable.js +25 -0
  736. package/dist/serialization/middlewares/BinaryMiddleware.d.ts +12 -0
  737. package/dist/serialization/middlewares/BinaryMiddleware.js +955 -0
  738. package/dist/serialization/middlewares/FileMiddleware.d.ts +9 -0
  739. package/dist/serialization/middlewares/FileMiddleware.js +546 -0
  740. package/dist/serialization/middlewares/ObjectMiddleware.d.ts +15 -0
  741. package/dist/serialization/middlewares/ObjectMiddleware.js +602 -0
  742. package/dist/serialization/middlewares/SingleItemMiddleware.d.ts +6 -0
  743. package/dist/serialization/middlewares/SingleItemMiddleware.js +15 -0
  744. package/dist/serialization/registerExternalSerializer.d.ts +1 -0
  745. package/dist/serialization/registerExternalSerializer.js +154 -0
  746. package/dist/serialization/serializers/ArraySerializer.d.ts +5 -0
  747. package/dist/serialization/serializers/ArraySerializer.js +18 -0
  748. package/dist/serialization/serializers/DateObjectSerializer.d.ts +5 -0
  749. package/dist/serialization/serializers/DateObjectSerializer.js +11 -0
  750. package/dist/serialization/serializers/ErrorObjectSerializer.d.ts +7 -0
  751. package/dist/serialization/serializers/ErrorObjectSerializer.js +20 -0
  752. package/dist/serialization/serializers/MapObjectSerializer.d.ts +5 -0
  753. package/dist/serialization/serializers/MapObjectSerializer.js +26 -0
  754. package/dist/serialization/serializers/NullPrototypeObjectSerializer.d.ts +5 -0
  755. package/dist/serialization/serializers/NullPrototypeObjectSerializer.js +28 -0
  756. package/dist/serialization/serializers/PlainObjectSerializer.d.ts +5 -0
  757. package/dist/serialization/serializers/PlainObjectSerializer.js +77 -0
  758. package/dist/serialization/serializers/RegExpObjectSerializer.d.ts +5 -0
  759. package/dist/serialization/serializers/RegExpObjectSerializer.js +12 -0
  760. package/dist/serialization/serializers/SetObjectSerializer.d.ts +5 -0
  761. package/dist/serialization/serializers/SetObjectSerializer.js +19 -0
  762. package/dist/sourcemap/EvalDevToolModulePlugin.d.ts +8 -0
  763. package/dist/sourcemap/EvalDevToolModulePlugin.js +97 -0
  764. package/dist/sourcemap/EvalSourceMapDevToolPlugin.d.ts +9 -0
  765. package/dist/sourcemap/EvalSourceMapDevToolPlugin.js +167 -0
  766. package/dist/sourcemap/SourceMapDevToolModuleOptionsPlugin.d.ts +6 -0
  767. package/dist/sourcemap/SourceMapDevToolModuleOptionsPlugin.js +29 -0
  768. package/dist/sourcemap/SourceMapDevToolPlugin.d.ts +11 -0
  769. package/dist/sourcemap/SourceMapDevToolPlugin.js +364 -0
  770. package/dist/template/ChunkTemplate.d.ts +6 -0
  771. package/dist/template/ChunkTemplate.js +69 -0
  772. package/dist/template/LibraryTemplatePlugin.d.ts +6 -0
  773. package/dist/template/LibraryTemplatePlugin.js +23 -0
  774. package/dist/template/MainTemplate.d.ts +10 -0
  775. package/dist/template/MainTemplate.js +177 -0
  776. package/dist/template/ModuleTemplate.d.ts +7 -0
  777. package/dist/template/ModuleTemplate.js +46 -0
  778. package/dist/template/RuntimeTemplate.d.ts +158 -0
  779. package/dist/template/RuntimeTemplate.js +663 -0
  780. package/dist/template/Template.d.ts +25 -0
  781. package/dist/template/Template.js +269 -0
  782. package/dist/template/TemplatedPathPlugin.d.ts +4 -0
  783. package/dist/template/TemplatedPathPlugin.js +228 -0
  784. package/dist/thread/WorkerError.d.ts +4 -0
  785. package/dist/thread/WorkerError.js +21 -0
  786. package/dist/thread/WorkerPool.d.ts +52 -0
  787. package/dist/thread/WorkerPool.js +370 -0
  788. package/dist/thread/readBuffer.d.ts +1 -0
  789. package/dist/thread/readBuffer.js +37 -0
  790. package/dist/thread/serializer.d.ts +2 -0
  791. package/dist/thread/serializer.js +24 -0
  792. package/dist/thread/worker.d.ts +1 -0
  793. package/dist/thread/worker.js +185 -0
  794. package/dist/thread/workerPools.d.ts +2 -0
  795. package/dist/thread/workerPools.js +31 -0
  796. package/dist/types/index.d.ts +58 -0
  797. package/dist/types/index.js +8 -0
  798. package/package.json +96 -0
@@ -0,0 +1,1552 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const util_1 = __importDefault(require("util"));
7
+ const ModuleTypeConstants_1 = require("@/module/ModuleTypeConstants");
8
+ const ModuleDependency_1 = __importDefault(require("@/dependencies/ModuleDependency"));
9
+ const formatLocation_1 = __importDefault(require("@/base/formatLocation"));
10
+ const Logger_1 = require("@/base/logging/Logger");
11
+ const AggressiveSplittingPlugin_1 = __importDefault(require("@/plugins/optimize/AggressiveSplittingPlugin"));
12
+ const IterableHelpers_1 = require("@/base/IterableHelpers");
13
+ const comparators_1 = require("@/base/comparators");
14
+ const identifier_1 = require("@/base/identifier");
15
+ const uniqueArray = (items, selector) => {
16
+ const set = new Set();
17
+ for (const item of items) {
18
+ for (const i of selector(item)) {
19
+ set.add(i);
20
+ }
21
+ }
22
+ return Array.from(set);
23
+ };
24
+ const uniqueOrderedArray = (items, selector, comparator) => uniqueArray(items, selector).sort(comparator);
25
+ const mapObject = (obj, fn) => {
26
+ const newObj = Object.create(null);
27
+ for (const key of Object.keys(obj)) {
28
+ newObj[key] = fn(obj[key], key);
29
+ }
30
+ return newObj;
31
+ };
32
+ const countWithChildren = (compilation, getItems) => {
33
+ let count = getItems(compilation, '').length;
34
+ for (const child of compilation.children) {
35
+ count += countWithChildren(child, (c, type) => getItems(c, `.children[].compilation${type}`));
36
+ }
37
+ return count;
38
+ };
39
+ const EXTRACT_ERROR = {
40
+ _: (object, error, context, { requestShortener }) => {
41
+ // TODO webpack 6 disallow strings in the errors/warnings list
42
+ if (typeof error === 'string') {
43
+ object.message = error;
44
+ }
45
+ else {
46
+ if (error.chunk) {
47
+ object.chunkName = error.chunk.name;
48
+ object.chunkEntry = error.chunk.hasRuntime();
49
+ object.chunkInitial = error.chunk.canBeInitial();
50
+ }
51
+ if (error.file) {
52
+ object.file = error.file;
53
+ }
54
+ if (error.module) {
55
+ object.moduleIdentifier = error.module.identifier();
56
+ object.moduleName = error.module.readableIdentifier(requestShortener);
57
+ }
58
+ if (error.loc) {
59
+ object.loc = (0, formatLocation_1.default)(error.loc);
60
+ }
61
+ object.message = error.message;
62
+ }
63
+ },
64
+ ids: (object, error, { compilation: { chunkGraph } }) => {
65
+ if (typeof error !== 'string') {
66
+ if (error.chunk) {
67
+ object.chunkId = error.chunk.id;
68
+ }
69
+ if (error.module) {
70
+ object.moduleId = chunkGraph.getModuleId(error.module);
71
+ }
72
+ }
73
+ },
74
+ moduleTrace: (object, error, context, options, factory) => {
75
+ if (typeof error !== 'string' && error.module) {
76
+ const { type, compilation: { moduleGraph }, } = context;
77
+ const visitedModules = new Set();
78
+ const moduleTrace = [];
79
+ let current = error.module;
80
+ while (current) {
81
+ if (visitedModules.has(current))
82
+ break; // circular (technically impossible, but how knows)
83
+ visitedModules.add(current);
84
+ const origin = moduleGraph.getIssuer(current);
85
+ if (!origin)
86
+ break;
87
+ moduleTrace.push({ origin, module: current });
88
+ current = origin;
89
+ }
90
+ object.moduleTrace = factory.create(`${type}.moduleTrace`, moduleTrace, context);
91
+ }
92
+ },
93
+ errorDetails: (object, error, { type, compilation, cachedGetErrors, cachedGetWarnings }, { errorDetails }) => {
94
+ if (typeof error !== 'string' &&
95
+ (errorDetails === true ||
96
+ (type.endsWith('.error') && cachedGetErrors(compilation).length < 3))) {
97
+ object.details = error.details;
98
+ }
99
+ },
100
+ errorStack: (object, error) => {
101
+ if (typeof error !== 'string') {
102
+ object.stack = error.stack;
103
+ }
104
+ },
105
+ };
106
+ const SIMPLE_EXTRACTORS = {
107
+ compilation: {
108
+ _: (object, compilation, context, options) => {
109
+ if (!context.makePathsRelative) {
110
+ context.makePathsRelative = identifier_1.makePathsRelative.bindContextCache(compilation.compiler.context, compilation.compiler.root);
111
+ }
112
+ if (!context.cachedGetErrors) {
113
+ const map = new WeakMap();
114
+ context.cachedGetErrors = compilation => (map.get(compilation) ||
115
+ // eslint-disable-next-line no-sequences
116
+ (errors => (map.set(compilation, errors), errors))(compilation.getErrors()));
117
+ }
118
+ if (!context.cachedGetWarnings) {
119
+ const map = new WeakMap();
120
+ context.cachedGetWarnings = compilation => (map.get(compilation) ||
121
+ // eslint-disable-next-line no-sequences
122
+ (warnings => (map.set(compilation, warnings), warnings))(compilation.getWarnings()));
123
+ }
124
+ if (compilation.name) {
125
+ object.name = compilation.name;
126
+ }
127
+ if (compilation.needAdditionalPass) {
128
+ object.needAdditionalPass = true;
129
+ }
130
+ const { logging, loggingDebug, loggingTrace } = options;
131
+ if (logging || (loggingDebug && loggingDebug.length > 0)) {
132
+ object.logging = {};
133
+ let acceptedTypes;
134
+ let collapsedGroups = false;
135
+ switch (logging) {
136
+ default:
137
+ acceptedTypes = new Set();
138
+ break;
139
+ case 'error':
140
+ acceptedTypes = new Set([Logger_1.LogType.error]);
141
+ break;
142
+ case 'warn':
143
+ acceptedTypes = new Set([Logger_1.LogType.error, Logger_1.LogType.warn]);
144
+ break;
145
+ case 'info':
146
+ acceptedTypes = new Set([Logger_1.LogType.error, Logger_1.LogType.warn, Logger_1.LogType.info]);
147
+ break;
148
+ case 'log':
149
+ acceptedTypes = new Set([
150
+ Logger_1.LogType.error,
151
+ Logger_1.LogType.warn,
152
+ Logger_1.LogType.info,
153
+ Logger_1.LogType.log,
154
+ Logger_1.LogType.group,
155
+ Logger_1.LogType.groupEnd,
156
+ Logger_1.LogType.groupCollapsed,
157
+ Logger_1.LogType.clear,
158
+ ]);
159
+ break;
160
+ case 'verbose':
161
+ acceptedTypes = new Set([
162
+ Logger_1.LogType.error,
163
+ Logger_1.LogType.warn,
164
+ Logger_1.LogType.info,
165
+ Logger_1.LogType.log,
166
+ Logger_1.LogType.group,
167
+ Logger_1.LogType.groupEnd,
168
+ Logger_1.LogType.groupCollapsed,
169
+ Logger_1.LogType.profile,
170
+ Logger_1.LogType.profileEnd,
171
+ Logger_1.LogType.time,
172
+ Logger_1.LogType.status,
173
+ Logger_1.LogType.clear,
174
+ ]);
175
+ collapsedGroups = true;
176
+ break;
177
+ }
178
+ const cachedMakePathsRelative = identifier_1.makePathsRelative.bindContextCache(options.context, compilation.compiler.root);
179
+ let depthInCollapsedGroup = 0;
180
+ for (const [origin, logEntries] of compilation.logging) {
181
+ const debugMode = loggingDebug.some(fn => fn(origin));
182
+ if (logging === false && !debugMode)
183
+ continue;
184
+ const groupStack = [];
185
+ const rootList = [];
186
+ let currentList = rootList;
187
+ let processedLogEntries = 0;
188
+ for (const entry of logEntries) {
189
+ let type = entry.type;
190
+ if (!debugMode && !acceptedTypes.has(type))
191
+ continue;
192
+ // Expand groups in verbose and debug modes
193
+ if (type === Logger_1.LogType.groupCollapsed && (debugMode || collapsedGroups))
194
+ type = Logger_1.LogType.group;
195
+ if (depthInCollapsedGroup === 0) {
196
+ processedLogEntries++;
197
+ }
198
+ if (type === Logger_1.LogType.groupEnd) {
199
+ groupStack.pop();
200
+ if (groupStack.length > 0) {
201
+ currentList = groupStack[groupStack.length - 1].children;
202
+ }
203
+ else {
204
+ currentList = rootList;
205
+ }
206
+ if (depthInCollapsedGroup > 0)
207
+ depthInCollapsedGroup--;
208
+ continue;
209
+ }
210
+ let message;
211
+ if (entry.type === Logger_1.LogType.time) {
212
+ message = `${entry.args[0]}: ${entry.args[1] * 1000 + entry.args[2] / 1000000} ms`;
213
+ }
214
+ else if (entry.args && entry.args.length > 0) {
215
+ message = util_1.default.format(entry.args[0], ...entry.args.slice(1));
216
+ }
217
+ const newEntry = Object.assign(Object.assign({}, entry), { type,
218
+ message, trace: loggingTrace ? entry.trace : undefined, children: type === Logger_1.LogType.group || type === Logger_1.LogType.groupCollapsed ? [] : undefined });
219
+ currentList.push(newEntry);
220
+ if (newEntry.children) {
221
+ groupStack.push(newEntry);
222
+ currentList = newEntry.children;
223
+ if (depthInCollapsedGroup > 0) {
224
+ depthInCollapsedGroup++;
225
+ }
226
+ else if (type === Logger_1.LogType.groupCollapsed) {
227
+ depthInCollapsedGroup = 1;
228
+ }
229
+ }
230
+ }
231
+ let name = cachedMakePathsRelative(origin).replace(/\|/g, ' ');
232
+ if (name in object.logging) {
233
+ let i = 1;
234
+ while (`${name}#${i}` in object.logging) {
235
+ i++;
236
+ }
237
+ name = `${name}#${i}`;
238
+ }
239
+ object.logging[name] = {
240
+ entries: rootList,
241
+ filteredEntries: logEntries.length - processedLogEntries,
242
+ debug: debugMode,
243
+ };
244
+ }
245
+ }
246
+ },
247
+ hash: (object, compilation) => {
248
+ object.hash = compilation.hash;
249
+ },
250
+ version: object => {
251
+ object.version = require('../../../package.json').version;
252
+ },
253
+ env: (object, compilation, context, { _env }) => {
254
+ object.env = _env;
255
+ },
256
+ timings: (object, compilation) => {
257
+ object.time = compilation.endTime - compilation.startTime;
258
+ },
259
+ builtAt: (object, compilation) => {
260
+ object.builtAt = compilation.endTime;
261
+ },
262
+ publicPath: (object, compilation) => {
263
+ object.publicPath = compilation.getPath(compilation.outputOptions.publicPath);
264
+ },
265
+ outputPath: (object, compilation) => {
266
+ object.outputPath = compilation.outputOptions.path;
267
+ },
268
+ assets: (object, compilation, context, options, factory) => {
269
+ const { type } = context;
270
+ const compilationFileToChunks = new Map();
271
+ const compilationAuxiliaryFileToChunks = new Map();
272
+ for (const chunk of compilation.chunks) {
273
+ for (const file of chunk.files) {
274
+ let array = compilationFileToChunks.get(file);
275
+ if (array === undefined) {
276
+ array = [];
277
+ compilationFileToChunks.set(file, array);
278
+ }
279
+ array.push(chunk);
280
+ }
281
+ for (const file of chunk.auxiliaryFiles) {
282
+ let array = compilationAuxiliaryFileToChunks.get(file);
283
+ if (array === undefined) {
284
+ array = [];
285
+ compilationAuxiliaryFileToChunks.set(file, array);
286
+ }
287
+ array.push(chunk);
288
+ }
289
+ }
290
+ const assetMap = new Map();
291
+ const assets = new Set();
292
+ for (const asset of compilation.getAssets()) {
293
+ const item = Object.assign(Object.assign({}, asset), { type: 'asset', related: undefined });
294
+ assets.add(item);
295
+ assetMap.set(asset.name, item);
296
+ }
297
+ for (const item of assetMap.values()) {
298
+ const related = item.info.related;
299
+ if (!related)
300
+ continue;
301
+ for (const type of Object.keys(related)) {
302
+ const relatedEntry = related[type];
303
+ const deps = Array.isArray(relatedEntry) ? relatedEntry : [relatedEntry];
304
+ for (const dep of deps) {
305
+ const depItem = assetMap.get(dep);
306
+ if (!depItem)
307
+ continue;
308
+ assets.delete(depItem);
309
+ depItem.type = type;
310
+ item.related = item.related || [];
311
+ item.related.push(depItem);
312
+ }
313
+ }
314
+ }
315
+ object.assetsByChunkName = {};
316
+ for (const [file, chunks] of compilationFileToChunks) {
317
+ for (const chunk of chunks) {
318
+ const name = chunk.name;
319
+ if (!name)
320
+ continue;
321
+ if (!Object.prototype.hasOwnProperty.call(object.assetsByChunkName, name)) {
322
+ object.assetsByChunkName[name] = [];
323
+ }
324
+ object.assetsByChunkName[name].push(file);
325
+ }
326
+ }
327
+ const groupedAssets = factory.create(`${type}.assets`, Array.from(assets), Object.assign(Object.assign({}, context), { compilationFileToChunks,
328
+ compilationAuxiliaryFileToChunks }));
329
+ const limited = spaceLimited(groupedAssets, options.assetsSpace);
330
+ object.assets = limited.children;
331
+ object.filteredAssets = limited.filteredChildren;
332
+ },
333
+ chunks: (object, compilation, context, options, factory) => {
334
+ const { type } = context;
335
+ object.chunks = factory.create(`${type}.chunks`, Array.from(compilation.chunks), context);
336
+ },
337
+ modules: (object, compilation, context, options, factory) => {
338
+ const { type } = context;
339
+ const array = Array.from(compilation.modules);
340
+ const groupedModules = factory.create(`${type}.modules`, array, context);
341
+ const limited = spaceLimited(groupedModules, options.modulesSpace);
342
+ object.modules = limited.children;
343
+ object.filteredModules = limited.filteredChildren;
344
+ },
345
+ entrypoints: (object, compilation, context, { entrypoints, chunkGroups, chunkGroupAuxiliary, chunkGroupChildren }, factory) => {
346
+ const { type } = context;
347
+ const array = Array.from(compilation.entrypoints, ([key, value]) => ({
348
+ name: key,
349
+ chunkGroup: value,
350
+ }));
351
+ if (entrypoints === 'auto' && !chunkGroups) {
352
+ if (array.length > 5)
353
+ return;
354
+ if (!chunkGroupChildren &&
355
+ array.every(({ chunkGroup }) => {
356
+ if (chunkGroup.chunks.length !== 1)
357
+ return false;
358
+ const chunk = chunkGroup.chunks[0];
359
+ return (chunk.files.size === 1 && (!chunkGroupAuxiliary || chunk.auxiliaryFiles.size === 0));
360
+ })) {
361
+ return;
362
+ }
363
+ }
364
+ object.entrypoints = factory.create(`${type}.entrypoints`, array, context);
365
+ },
366
+ chunkGroups: (object, compilation, context, options, factory) => {
367
+ const { type } = context;
368
+ const array = Array.from(compilation.namedChunkGroups, ([key, value]) => ({
369
+ name: key,
370
+ chunkGroup: value,
371
+ }));
372
+ object.namedChunkGroups = factory.create(`${type}.namedChunkGroups`, array, context);
373
+ },
374
+ errors: (object, compilation, context, options, factory) => {
375
+ const { type, cachedGetErrors } = context;
376
+ const rawErrors = cachedGetErrors(compilation);
377
+ const factorizedErrors = factory.create(`${type}.errors`, cachedGetErrors(compilation), context);
378
+ let filtered = 0;
379
+ if (options.errorDetails === 'auto' && rawErrors.length >= 3) {
380
+ filtered = rawErrors.map(e => typeof e !== 'string' && e.details).filter(Boolean).length;
381
+ }
382
+ if (options.errorDetails === true || !Number.isFinite(options.errorsSpace)) {
383
+ object.errors = factorizedErrors;
384
+ if (filtered)
385
+ object.filteredErrorDetailsCount = filtered;
386
+ return;
387
+ }
388
+ const [errors, filteredBySpace] = errorsSpaceLimit(factorizedErrors, options.errorsSpace);
389
+ object.filteredErrorDetailsCount = filtered + filteredBySpace;
390
+ object.errors = errors;
391
+ },
392
+ errorsCount: (object, compilation, { cachedGetErrors }) => {
393
+ object.errorsCount = countWithChildren(compilation, c => cachedGetErrors(c));
394
+ },
395
+ warnings: (object, compilation, context, options, factory) => {
396
+ const { type, cachedGetWarnings } = context;
397
+ const rawWarnings = factory.create(`${type}.warnings`, cachedGetWarnings(compilation), context);
398
+ let filtered = 0;
399
+ if (options.errorDetails === 'auto') {
400
+ filtered = cachedGetWarnings(compilation)
401
+ .map(e => typeof e !== 'string' && e.details)
402
+ .filter(Boolean).length;
403
+ }
404
+ if (options.errorDetails === true || !Number.isFinite(options.warningsSpace)) {
405
+ object.warnings = rawWarnings;
406
+ if (filtered)
407
+ object.filteredWarningDetailsCount = filtered;
408
+ return;
409
+ }
410
+ const [warnings, filteredBySpace] = errorsSpaceLimit(rawWarnings, options.warningsSpace);
411
+ object.filteredWarningDetailsCount = filtered + filteredBySpace;
412
+ object.warnings = warnings;
413
+ },
414
+ warningsCount: (object, compilation, context, { warningsFilter }, factory) => {
415
+ const { type, cachedGetWarnings } = context;
416
+ object.warningsCount = countWithChildren(compilation, (c, childType) => {
417
+ if (!warningsFilter && warningsFilter.length === 0)
418
+ return cachedGetWarnings(c);
419
+ return factory
420
+ .create(`${type}${childType}.warnings`, cachedGetWarnings(c), context)
421
+ .filter(warning => {
422
+ const warningString = Object.keys(warning)
423
+ .map(key => `${warning[key]}`)
424
+ .join('\n');
425
+ return !warningsFilter.some(filter => filter(warning, warningString));
426
+ });
427
+ });
428
+ },
429
+ children: (object, compilation, context, options, factory) => {
430
+ const { type } = context;
431
+ object.children = factory.create(`${type}.children`, compilation.children, context);
432
+ },
433
+ },
434
+ asset: {
435
+ _: (object, asset, context, options, factory) => {
436
+ const { compilation } = context;
437
+ object.type = asset.type;
438
+ object.name = asset.name;
439
+ object.size = asset.source.size();
440
+ object.emitted = compilation.emittedAssets.has(asset.name);
441
+ object.comparedForEmit = compilation.comparedForEmitAssets.has(asset.name);
442
+ const cached = !object.emitted && !object.comparedForEmit;
443
+ object.cached = cached;
444
+ object.info = asset.info;
445
+ if (!cached || options.cachedAssets) {
446
+ Object.assign(object, factory.create(`${context.type}$visible`, asset, context));
447
+ }
448
+ },
449
+ },
450
+ asset$visible: {
451
+ _: (object, asset, { compilation, compilationFileToChunks, compilationAuxiliaryFileToChunks }) => {
452
+ const chunks = compilationFileToChunks.get(asset.name) || [];
453
+ const auxiliaryChunks = compilationAuxiliaryFileToChunks.get(asset.name) || [];
454
+ object.chunkNames = uniqueOrderedArray(chunks, c => (c.name ? [c.name] : []), comparators_1.compareIds);
455
+ object.chunkIdHints = uniqueOrderedArray(chunks, c => Array.from(c.idNameHints), comparators_1.compareIds);
456
+ object.auxiliaryChunkNames = uniqueOrderedArray(auxiliaryChunks, c => (c.name ? [c.name] : []), comparators_1.compareIds);
457
+ object.auxiliaryChunkIdHints = uniqueOrderedArray(auxiliaryChunks, c => Array.from(c.idNameHints), comparators_1.compareIds);
458
+ object.filteredRelated = asset.related ? asset.related.length : undefined;
459
+ },
460
+ relatedAssets: (object, asset, context, options, factory) => {
461
+ const { type } = context;
462
+ object.related = factory.create(`${type.slice(0, -8)}.related`, asset.related, context);
463
+ object.filteredRelated = asset.related
464
+ ? asset.related.length - object.related.length
465
+ : undefined;
466
+ },
467
+ ids: (object, asset, { compilationFileToChunks, compilationAuxiliaryFileToChunks }) => {
468
+ const chunks = compilationFileToChunks.get(asset.name) || [];
469
+ const auxiliaryChunks = compilationAuxiliaryFileToChunks.get(asset.name) || [];
470
+ object.chunks = uniqueOrderedArray(chunks, c => c.ids, comparators_1.compareIds);
471
+ object.auxiliaryChunks = uniqueOrderedArray(auxiliaryChunks, c => c.ids, comparators_1.compareIds);
472
+ },
473
+ },
474
+ chunkGroup: {
475
+ _: (object, { name, chunkGroup }, { compilation, compilation: { moduleGraph, chunkGraph, getAsset } }, { ids, chunkGroupAuxiliary, chunkGroupChildren, chunkGroupMaxAssets }) => {
476
+ const children = chunkGroupChildren && chunkGroup.getChildrenByOrders(moduleGraph, chunkGraph);
477
+ const toAsset = name => {
478
+ const asset = compilation.getAsset(name);
479
+ return {
480
+ name,
481
+ size: asset ? asset.info.size : -1,
482
+ };
483
+ };
484
+ const sizeReducer = (total, { size }) => total + size;
485
+ const assets = uniqueArray(chunkGroup.chunks, c => c.files).map(toAsset);
486
+ const auxiliaryAssets = uniqueOrderedArray(chunkGroup.chunks, c => c.auxiliaryFiles, comparators_1.compareIds).map(toAsset);
487
+ const assetsSize = assets.reduce(sizeReducer, 0);
488
+ const auxiliaryAssetsSize = auxiliaryAssets.reduce(sizeReducer, 0);
489
+ const statsChunkGroup = {
490
+ name,
491
+ chunks: ids ? chunkGroup.chunks.map(c => c.id) : undefined,
492
+ assets: assets.length <= chunkGroupMaxAssets ? assets : undefined,
493
+ filteredAssets: assets.length <= chunkGroupMaxAssets ? 0 : assets.length,
494
+ assetsSize,
495
+ auxiliaryAssets: chunkGroupAuxiliary && auxiliaryAssets.length <= chunkGroupMaxAssets
496
+ ? auxiliaryAssets
497
+ : undefined,
498
+ filteredAuxiliaryAssets: chunkGroupAuxiliary && auxiliaryAssets.length <= chunkGroupMaxAssets
499
+ ? 0
500
+ : auxiliaryAssets.length,
501
+ auxiliaryAssetsSize,
502
+ children: children
503
+ ? mapObject(children, groups => groups.map(group => {
504
+ const assets = uniqueArray(group.chunks, c => c.files).map(toAsset);
505
+ const auxiliaryAssets = uniqueOrderedArray(group.chunks, c => c.auxiliaryFiles, comparators_1.compareIds).map(toAsset);
506
+ const childStatsChunkGroup = {
507
+ name: group.name,
508
+ chunks: ids ? group.chunks.map(c => c.id) : undefined,
509
+ assets: assets.length <= chunkGroupMaxAssets ? assets : undefined,
510
+ filteredAssets: assets.length <= chunkGroupMaxAssets ? 0 : assets.length,
511
+ auxiliaryAssets: chunkGroupAuxiliary && auxiliaryAssets.length <= chunkGroupMaxAssets
512
+ ? auxiliaryAssets
513
+ : undefined,
514
+ filteredAuxiliaryAssets: chunkGroupAuxiliary && auxiliaryAssets.length <= chunkGroupMaxAssets
515
+ ? 0
516
+ : auxiliaryAssets.length,
517
+ };
518
+ return childStatsChunkGroup;
519
+ }))
520
+ : undefined,
521
+ childAssets: children
522
+ ? mapObject(children, groups => {
523
+ const set = new Set();
524
+ for (const group of groups) {
525
+ for (const chunk of group.chunks) {
526
+ for (const asset of chunk.files) {
527
+ set.add(asset);
528
+ }
529
+ }
530
+ }
531
+ return Array.from(set);
532
+ })
533
+ : undefined,
534
+ };
535
+ Object.assign(object, statsChunkGroup);
536
+ },
537
+ },
538
+ module: {
539
+ _: (object, module, context, options, factory) => {
540
+ const { compilation, type } = context;
541
+ const built = compilation.builtModules.has(module);
542
+ const codeGenerated = compilation.codeGeneratedModules.has(module);
543
+ const buildTimeExecuted = compilation.buildTimeExecutedModules.has(module);
544
+ const sizes = {};
545
+ for (const sourceType of module.getSourceTypes()) {
546
+ sizes[sourceType] = module.size(sourceType);
547
+ }
548
+ const statsModule = {
549
+ type: 'module',
550
+ moduleType: module.type,
551
+ layer: module.layer,
552
+ size: module.size(),
553
+ sizes,
554
+ built,
555
+ codeGenerated,
556
+ buildTimeExecuted,
557
+ cached: !built && !codeGenerated,
558
+ };
559
+ Object.assign(object, statsModule);
560
+ if (built || codeGenerated || options.cachedModules) {
561
+ Object.assign(object, factory.create(`${type}$visible`, module, context));
562
+ }
563
+ },
564
+ },
565
+ module$visible: {
566
+ _: (object, module, context, { requestShortener }, factory) => {
567
+ const { compilation, type, rootModules } = context;
568
+ const { moduleGraph } = compilation;
569
+ const path = [];
570
+ const issuer = moduleGraph.getIssuer(module);
571
+ let current = issuer;
572
+ while (current) {
573
+ path.push(current);
574
+ current = moduleGraph.getIssuer(current);
575
+ }
576
+ path.reverse();
577
+ const profile = moduleGraph.getProfile(module);
578
+ const errors = module.getErrors();
579
+ const errorsCount = errors !== undefined ? (0, IterableHelpers_1.countIterable)(errors) : 0;
580
+ const warnings = module.getWarnings();
581
+ const warningsCount = warnings !== undefined ? (0, IterableHelpers_1.countIterable)(warnings) : 0;
582
+ const sizes = {};
583
+ for (const sourceType of module.getSourceTypes()) {
584
+ sizes[sourceType] = module.size(sourceType);
585
+ }
586
+ const statsModule = {
587
+ identifier: module.identifier(),
588
+ name: module.readableIdentifier(requestShortener),
589
+ nameForCondition: module.nameForCondition(),
590
+ index: moduleGraph.getPreOrderIndex(module),
591
+ preOrderIndex: moduleGraph.getPreOrderIndex(module),
592
+ index2: moduleGraph.getPostOrderIndex(module),
593
+ postOrderIndex: moduleGraph.getPostOrderIndex(module),
594
+ cacheable: module.buildInfo.cacheable,
595
+ optional: module.isOptional(moduleGraph),
596
+ orphan: !type.endsWith('module.modules[].module$visible') &&
597
+ compilation.chunkGraph.getNumberOfModuleChunks(module) === 0,
598
+ dependent: rootModules ? !rootModules.has(module) : undefined,
599
+ issuer: issuer === null || issuer === void 0 ? void 0 : issuer.identifier(),
600
+ issuerName: issuer === null || issuer === void 0 ? void 0 : issuer.readableIdentifier(requestShortener),
601
+ issuerPath: issuer && factory.create(`${type.slice(0, -8)}.issuerPath`, path, context),
602
+ failed: errorsCount > 0,
603
+ errors: errorsCount,
604
+ warnings: warningsCount,
605
+ };
606
+ Object.assign(object, statsModule);
607
+ if (profile) {
608
+ object.profile = factory.create(`${type.slice(0, -8)}.profile`, profile, context);
609
+ }
610
+ },
611
+ ids: (object, module, { compilation: { chunkGraph, moduleGraph } }) => {
612
+ object.id = chunkGraph.getModuleId(module);
613
+ const issuer = moduleGraph.getIssuer(module);
614
+ object.issuerId = issuer && chunkGraph.getModuleId(issuer);
615
+ object.chunks = Array.from(chunkGraph.getOrderedModuleChunksIterable(module, comparators_1.compareChunksById), (chunk) => chunk.id);
616
+ },
617
+ moduleAssets: (object, module) => {
618
+ object.assets = module.buildInfo.assets ? Object.keys(module.buildInfo.assets) : [];
619
+ },
620
+ reasons: (object, module, context, options, factory) => {
621
+ const { type, compilation: { moduleGraph }, } = context;
622
+ const groupsReasons = factory.create(`${type.slice(0, -8)}.reasons`, Array.from(moduleGraph.getIncomingConnections(module)), context);
623
+ const limited = spaceLimited(groupsReasons, options.reasonsSpace);
624
+ object.reasons = limited.children;
625
+ object.filteredReasons = limited.filteredChildren;
626
+ },
627
+ usedExports: (object, module, { runtime, compilation: { moduleGraph } }) => {
628
+ const usedExports = moduleGraph.getUsedExports(module, runtime);
629
+ if (usedExports === null) {
630
+ object.usedExports = null;
631
+ }
632
+ else if (typeof usedExports === 'boolean') {
633
+ object.usedExports = usedExports;
634
+ }
635
+ else {
636
+ object.usedExports = Array.from(usedExports);
637
+ }
638
+ },
639
+ providedExports: (object, module, { compilation: { moduleGraph } }) => {
640
+ const providedExports = moduleGraph.getProvidedExports(module);
641
+ object.providedExports = Array.isArray(providedExports) ? providedExports : null;
642
+ },
643
+ optimizationBailout: (object, module, { compilation: { moduleGraph } }, { requestShortener }) => {
644
+ object.optimizationBailout = moduleGraph.getOptimizationBailout(module).map(item => {
645
+ if (typeof item === 'function')
646
+ return item(requestShortener);
647
+ return item;
648
+ });
649
+ },
650
+ depth: (object, module, { compilation: { moduleGraph } }) => {
651
+ object.depth = moduleGraph.getDepth(module);
652
+ },
653
+ nestedModules: (object, module, context, options, factory) => {
654
+ const { type } = context;
655
+ const innerModules = module.modules;
656
+ if (Array.isArray(innerModules)) {
657
+ const groupedModules = factory.create(`${type.slice(0, -8)}.modules`, innerModules, context);
658
+ const limited = spaceLimited(groupedModules, options.nestedModulesSpace);
659
+ object.modules = limited.children;
660
+ object.filteredModules = limited.filteredChildren;
661
+ }
662
+ },
663
+ source: (object, module) => {
664
+ const originalSource = module.originalSource();
665
+ if (originalSource) {
666
+ object.source = originalSource.source();
667
+ }
668
+ },
669
+ },
670
+ profile: {
671
+ _: (object, profile) => {
672
+ const statsProfile = {
673
+ total: profile.factory +
674
+ profile.restoring +
675
+ profile.integration +
676
+ profile.building +
677
+ profile.storing,
678
+ resolving: profile.factory,
679
+ restoring: profile.restoring,
680
+ building: profile.building,
681
+ integration: profile.integration,
682
+ storing: profile.storing,
683
+ additionalResolving: profile.additionalFactories,
684
+ additionalIntegration: profile.additionalIntegration,
685
+ // TODO remove this in webpack 6
686
+ factory: profile.factory,
687
+ // TODO remove this in webpack 6
688
+ dependencies: profile.additionalFactories,
689
+ };
690
+ Object.assign(object, statsProfile);
691
+ },
692
+ },
693
+ moduleIssuer: {
694
+ _: (object, module, context, { requestShortener }, factory) => {
695
+ const { compilation, type } = context;
696
+ const { moduleGraph } = compilation;
697
+ const profile = moduleGraph.getProfile(module);
698
+ const statsModuleIssuer = {
699
+ identifier: module.identifier(),
700
+ name: module.readableIdentifier(requestShortener),
701
+ };
702
+ Object.assign(object, statsModuleIssuer);
703
+ if (profile) {
704
+ object.profile = factory.create(`${type}.profile`, profile, context);
705
+ }
706
+ },
707
+ ids: (object, module, { compilation: { chunkGraph } }) => {
708
+ object.id = chunkGraph.getModuleId(module);
709
+ },
710
+ },
711
+ moduleReason: {
712
+ _: (object, reason, { runtime }, { requestShortener }) => {
713
+ const dep = reason.dependency;
714
+ const moduleDep = dep && dep instanceof ModuleDependency_1.default ? dep : undefined;
715
+ const statsModuleReason = {
716
+ moduleIdentifier: reason.originModule ? reason.originModule.identifier() : null,
717
+ module: reason.originModule
718
+ ? reason.originModule.readableIdentifier(requestShortener)
719
+ : null,
720
+ moduleName: reason.originModule
721
+ ? reason.originModule.readableIdentifier(requestShortener)
722
+ : null,
723
+ resolvedModuleIdentifier: reason.resolvedOriginModule
724
+ ? reason.resolvedOriginModule.identifier()
725
+ : null,
726
+ resolvedModule: reason.resolvedOriginModule
727
+ ? reason.resolvedOriginModule.readableIdentifier(requestShortener)
728
+ : null,
729
+ type: reason.dependency ? reason.dependency.type : null,
730
+ active: reason.isActive(runtime),
731
+ explanation: reason.explanation,
732
+ userRequest: (moduleDep === null || moduleDep === void 0 ? void 0 : moduleDep.userRequest) || null,
733
+ };
734
+ Object.assign(object, statsModuleReason);
735
+ if (reason.dependency) {
736
+ const locInfo = (0, formatLocation_1.default)(reason.dependency.loc);
737
+ if (locInfo) {
738
+ object.loc = locInfo;
739
+ }
740
+ }
741
+ },
742
+ ids: (object, reason, { compilation: { chunkGraph } }) => {
743
+ object.moduleId = reason.originModule ? chunkGraph.getModuleId(reason.originModule) : null;
744
+ object.resolvedModuleId = reason.resolvedOriginModule
745
+ ? chunkGraph.getModuleId(reason.resolvedOriginModule)
746
+ : null;
747
+ },
748
+ },
749
+ chunk: {
750
+ _: (object, chunk, { makePathsRelative, compilation: { chunkGraph } }) => {
751
+ const childIdByOrder = chunk.getChildIdsByOrders(chunkGraph);
752
+ const statsChunk = {
753
+ rendered: chunk.rendered,
754
+ initial: chunk.canBeInitial(),
755
+ entry: chunk.hasRuntime(),
756
+ recorded: AggressiveSplittingPlugin_1.default.wasChunkRecorded(chunk),
757
+ reason: chunk.chunkReason,
758
+ size: chunkGraph.getChunkModulesSize(chunk),
759
+ sizes: chunkGraph.getChunkModulesSizes(chunk),
760
+ names: chunk.name ? [chunk.name] : [],
761
+ idHints: Array.from(chunk.idNameHints),
762
+ runtime: chunk.runtime === undefined
763
+ ? undefined
764
+ : typeof chunk.runtime === 'string'
765
+ ? [makePathsRelative(chunk.runtime)]
766
+ : Array.from(chunk.runtime.sort(), makePathsRelative),
767
+ files: Array.from(chunk.files),
768
+ auxiliaryFiles: Array.from(chunk.auxiliaryFiles).sort(comparators_1.compareIds),
769
+ hash: chunk.renderedHash,
770
+ childrenByOrder: childIdByOrder,
771
+ };
772
+ Object.assign(object, statsChunk);
773
+ },
774
+ ids: (object, chunk) => {
775
+ object.id = chunk.id;
776
+ },
777
+ chunkRelations: (object, chunk, { compilation: { chunkGraph } }) => {
778
+ const parents = new Set();
779
+ const children = new Set();
780
+ const siblings = new Set();
781
+ for (const chunkGroup of chunk.groupsIterable) {
782
+ for (const parentGroup of chunkGroup.parentsIterable) {
783
+ for (const chunk of parentGroup.chunks) {
784
+ parents.add(chunk.id);
785
+ }
786
+ }
787
+ for (const childGroup of chunkGroup.childrenIterable) {
788
+ for (const chunk of childGroup.chunks) {
789
+ children.add(chunk.id);
790
+ }
791
+ }
792
+ for (const sibling of chunkGroup.chunks) {
793
+ if (sibling !== chunk)
794
+ siblings.add(sibling.id);
795
+ }
796
+ }
797
+ object.siblings = Array.from(siblings).sort(comparators_1.compareIds);
798
+ object.parents = Array.from(parents).sort(comparators_1.compareIds);
799
+ object.children = Array.from(children).sort(comparators_1.compareIds);
800
+ },
801
+ chunkModules: (object, chunk, context, options, factory) => {
802
+ const { type, compilation: { chunkGraph }, } = context;
803
+ const array = chunkGraph.getChunkModules(chunk);
804
+ const groupedModules = factory.create(`${type}.modules`, array, Object.assign(Object.assign({}, context), { runtime: chunk.runtime, rootModules: new Set(chunkGraph.getChunkRootModules(chunk)) }));
805
+ const limited = spaceLimited(groupedModules, options.chunkModulesSpace);
806
+ object.modules = limited.children;
807
+ object.filteredModules = limited.filteredChildren;
808
+ },
809
+ chunkOrigins: (object, chunk, context, options, factory) => {
810
+ const { type, compilation: { chunkGraph }, } = context;
811
+ const originsKeySet = new Set();
812
+ const origins = [];
813
+ for (const g of chunk.groupsIterable) {
814
+ origins.push(...g.origins);
815
+ }
816
+ const array = origins.filter((origin) => {
817
+ const key = [
818
+ origin.module ? chunkGraph.getModuleId(origin.module) : undefined,
819
+ (0, formatLocation_1.default)(origin.loc),
820
+ origin.request,
821
+ ].join();
822
+ if (originsKeySet.has(key))
823
+ return false;
824
+ originsKeySet.add(key);
825
+ return true;
826
+ });
827
+ object.origins = factory.create(`${type}.origins`, array, context);
828
+ },
829
+ },
830
+ chunkOrigin: {
831
+ _: (object, origin, context, { requestShortener }) => {
832
+ const statsChunkOrigin = {
833
+ module: origin.module ? origin.module.identifier() : '',
834
+ moduleIdentifier: origin.module ? origin.module.identifier() : '',
835
+ moduleName: origin.module ? origin.module.readableIdentifier(requestShortener) : '',
836
+ loc: (0, formatLocation_1.default)(origin.loc),
837
+ request: origin.request,
838
+ };
839
+ Object.assign(object, statsChunkOrigin);
840
+ },
841
+ ids: (object, origin, { compilation: { chunkGraph } }) => {
842
+ object.moduleId = origin.module ? chunkGraph.getModuleId(origin.module) : undefined;
843
+ },
844
+ },
845
+ error: EXTRACT_ERROR,
846
+ warning: EXTRACT_ERROR,
847
+ moduleTraceItem: {
848
+ _: (object, { origin, module }, context, { requestShortener }, factory) => {
849
+ const { type, compilation: { moduleGraph }, } = context;
850
+ object.originIdentifier = origin.identifier();
851
+ object.originName = origin.readableIdentifier(requestShortener);
852
+ object.moduleIdentifier = module.identifier();
853
+ object.moduleName = module.readableIdentifier(requestShortener);
854
+ const dependencies = Array.from(moduleGraph.getIncomingConnections(module))
855
+ .filter((c) => c.resolvedOriginModule === origin && c.dependency)
856
+ .map((c) => c.dependency);
857
+ object.dependencies = factory.create(`${type}.dependencies`, Array.from(new Set(dependencies)), context);
858
+ },
859
+ ids: (object, { origin, module }, { compilation: { chunkGraph } }) => {
860
+ object.originId = chunkGraph.getModuleId(origin);
861
+ object.moduleId = chunkGraph.getModuleId(module);
862
+ },
863
+ },
864
+ moduleTraceDependency: {
865
+ _: (object, dependency) => {
866
+ object.loc = (0, formatLocation_1.default)(dependency.loc);
867
+ },
868
+ },
869
+ };
870
+ const FILTER = {
871
+ 'module.reasons': {
872
+ '!orphanModules': (reason, { compilation: { chunkGraph } }) => {
873
+ if (reason.originModule && chunkGraph.getNumberOfModuleChunks(reason.originModule) === 0) {
874
+ return false;
875
+ }
876
+ },
877
+ },
878
+ };
879
+ const FILTER_RESULTS = {
880
+ 'compilation.warnings': {
881
+ warningsFilter: util_1.default.deprecate((warning, context, { warningsFilter }) => {
882
+ const warningString = Object.keys(warning)
883
+ .map(key => `${warning[key]}`)
884
+ .join('\n');
885
+ return !warningsFilter.some(filter => filter(warning, warningString));
886
+ }, '@/config.stats.warningsFilter is deprecated in favor of config.ignoreWarnings', 'DEP_WEBPACK_STATS_WARNINGS_FILTER'),
887
+ },
888
+ };
889
+ const MODULES_SORTER = {
890
+ _: (comparators, { compilation: { moduleGraph } }) => {
891
+ comparators.push((0, comparators_1.compareSelect)(m => moduleGraph.getDepth(m), comparators_1.compareNumbers), (0, comparators_1.compareSelect)(m => moduleGraph.getPreOrderIndex(m), comparators_1.compareNumbers), (0, comparators_1.compareSelect)(m => m.identifier(), comparators_1.compareIds));
892
+ },
893
+ };
894
+ const SORTERS = {
895
+ 'compilation.chunks': {
896
+ _: comparators => {
897
+ comparators.push((0, comparators_1.compareSelect)(c => c.id, comparators_1.compareIds));
898
+ },
899
+ },
900
+ 'compilation.modules': MODULES_SORTER,
901
+ 'chunk.rootModules': MODULES_SORTER,
902
+ 'chunk.modules': MODULES_SORTER,
903
+ 'module.modules': MODULES_SORTER,
904
+ 'module.reasons': {
905
+ _: (comparators, { compilation: { chunkGraph } }) => {
906
+ comparators.push((0, comparators_1.compareSelect)(x => x.originModule, comparators_1.compareModulesByIdentifier));
907
+ comparators.push((0, comparators_1.compareSelect)(x => x.resolvedOriginModule, comparators_1.compareModulesByIdentifier));
908
+ comparators.push((0, comparators_1.compareSelect)(x => x.dependency, (0, comparators_1.concatComparators)((0, comparators_1.compareSelect)(x => x.loc, comparators_1.compareLocations), (0, comparators_1.compareSelect)(x => x.type, comparators_1.compareIds))));
909
+ },
910
+ },
911
+ 'chunk.origins': {
912
+ _: (comparators, { compilation: { chunkGraph } }) => {
913
+ comparators.push((0, comparators_1.compareSelect)(origin => (origin.module ? chunkGraph.getModuleId(origin.module) : undefined), comparators_1.compareIds), (0, comparators_1.compareSelect)(origin => (0, formatLocation_1.default)(origin.loc), comparators_1.compareIds), (0, comparators_1.compareSelect)(origin => origin.request, comparators_1.compareIds));
914
+ },
915
+ },
916
+ };
917
+ const getItemSize = item =>
918
+ // Each item takes 1 line
919
+ // + the size of the children
920
+ // + 1 extra line when it has children and filteredChildren
921
+ !item.children
922
+ ? 1
923
+ : item.filteredChildren
924
+ ? 2 + getTotalSize(item.children)
925
+ : 1 + getTotalSize(item.children);
926
+ const getTotalSize = children => {
927
+ let size = 0;
928
+ for (const child of children) {
929
+ size += getItemSize(child);
930
+ }
931
+ return size;
932
+ };
933
+ const getTotalItems = children => {
934
+ let count = 0;
935
+ for (const child of children) {
936
+ if (!child.children && !child.filteredChildren) {
937
+ count++;
938
+ }
939
+ else {
940
+ if (child.children)
941
+ count += getTotalItems(child.children);
942
+ if (child.filteredChildren)
943
+ count += child.filteredChildren;
944
+ }
945
+ }
946
+ return count;
947
+ };
948
+ const collapse = children => {
949
+ // After collapse each child must take exactly one line
950
+ const newChildren = [];
951
+ for (const child of children) {
952
+ if (child.children) {
953
+ let filteredChildren = child.filteredChildren || 0;
954
+ filteredChildren += getTotalItems(child.children);
955
+ newChildren.push(Object.assign(Object.assign({}, child), { children: undefined, filteredChildren }));
956
+ }
957
+ else {
958
+ newChildren.push(child);
959
+ }
960
+ }
961
+ return newChildren;
962
+ };
963
+ const spaceLimited = (itemsAndGroups, max, filteredChildrenLineReserved = false) => {
964
+ if (max < 1) {
965
+ return {
966
+ children: undefined,
967
+ filteredChildren: getTotalItems(itemsAndGroups),
968
+ };
969
+ }
970
+ let children;
971
+ let filteredChildren;
972
+ // This are the groups, which take 1+ lines each
973
+ const groups = [];
974
+ // The sizes of the groups are stored in groupSizes
975
+ const groupSizes = [];
976
+ // This are the items, which take 1 line each
977
+ const items = [];
978
+ // The total of group sizes
979
+ let groupsSize = 0;
980
+ for (const itemOrGroup of itemsAndGroups) {
981
+ // is item
982
+ if (!itemOrGroup.children && !itemOrGroup.filteredChildren) {
983
+ items.push(itemOrGroup);
984
+ }
985
+ else {
986
+ groups.push(itemOrGroup);
987
+ const size = getItemSize(itemOrGroup);
988
+ groupSizes.push(size);
989
+ groupsSize += size;
990
+ }
991
+ }
992
+ if (groupsSize + items.length <= max) {
993
+ // The total size in the current state fits into the max
994
+ // keep all
995
+ children = groups.length > 0 ? groups.concat(items) : items;
996
+ }
997
+ else if (groups.length === 0) {
998
+ // slice items to max
999
+ // inner space marks that lines for filteredChildren already reserved
1000
+ const limit = max - (filteredChildrenLineReserved ? 0 : 1);
1001
+ filteredChildren = items.length - limit;
1002
+ items.length = limit;
1003
+ children = items;
1004
+ }
1005
+ else {
1006
+ // limit is the size when all groups are collapsed
1007
+ const limit = groups.length + (filteredChildrenLineReserved || items.length === 0 ? 0 : 1);
1008
+ if (limit < max) {
1009
+ // calculate how much we are over the size limit
1010
+ // this allows to approach the limit faster
1011
+ let oversize;
1012
+ // If each group would take 1 line the total would be below the maximum
1013
+ // collapse some groups, keep items
1014
+ while ((oversize =
1015
+ groupsSize +
1016
+ items.length +
1017
+ (filteredChildren && !filteredChildrenLineReserved ? 1 : 0) -
1018
+ max) > 0) {
1019
+ // Find the maximum group and process only this one
1020
+ const maxGroupSize = Math.max(...groupSizes);
1021
+ if (maxGroupSize < items.length) {
1022
+ filteredChildren = items.length;
1023
+ items.length = 0;
1024
+ continue;
1025
+ }
1026
+ for (let i = 0; i < groups.length; i++) {
1027
+ if (groupSizes[i] === maxGroupSize) {
1028
+ const group = groups[i];
1029
+ // run this algorithm recursively and limit the size of the children to
1030
+ // current size - oversize / number of groups
1031
+ // So it should always end up being smaller
1032
+ const headerSize = group.filteredChildren ? 2 : 1;
1033
+ const limited = spaceLimited(group.children, maxGroupSize -
1034
+ // we should use ceil to always feet in max
1035
+ Math.ceil(oversize / groups.length) -
1036
+ // we substitute size of group head
1037
+ headerSize, headerSize === 2);
1038
+ groups[i] = Object.assign(Object.assign({}, group), { children: limited.children, filteredChildren: limited.filteredChildren
1039
+ ? (group.filteredChildren || 0) + limited.filteredChildren
1040
+ : group.filteredChildren });
1041
+ const newSize = getItemSize(groups[i]);
1042
+ groupsSize -= maxGroupSize - newSize;
1043
+ groupSizes[i] = newSize;
1044
+ break;
1045
+ }
1046
+ }
1047
+ }
1048
+ children = groups.concat(items);
1049
+ }
1050
+ else if (limit === max) {
1051
+ // If we have only enough space to show one line per group and one line for the filtered items
1052
+ // collapse all groups and items
1053
+ children = collapse(groups);
1054
+ filteredChildren = items.length;
1055
+ }
1056
+ else {
1057
+ // If we have no space
1058
+ // collapse complete group
1059
+ filteredChildren = getTotalItems(itemsAndGroups);
1060
+ }
1061
+ }
1062
+ return {
1063
+ children,
1064
+ filteredChildren,
1065
+ };
1066
+ };
1067
+ const errorsSpaceLimit = (errors, max) => {
1068
+ let filtered = 0;
1069
+ // Can not fit into limit
1070
+ // print only messages
1071
+ if (errors.length + 1 >= max)
1072
+ return [
1073
+ errors.map(error => {
1074
+ if (typeof error === 'string' || !error.details)
1075
+ return error;
1076
+ filtered++;
1077
+ return Object.assign(Object.assign({}, error), { details: '' });
1078
+ }),
1079
+ filtered,
1080
+ ];
1081
+ let fullLength = errors.length;
1082
+ let result = errors;
1083
+ let i = 0;
1084
+ for (; i < errors.length; i++) {
1085
+ const error = errors[i];
1086
+ if (typeof error !== 'string' && error.details) {
1087
+ const splitted = error.details.split('\n');
1088
+ const len = splitted.length;
1089
+ fullLength += len;
1090
+ if (fullLength > max) {
1091
+ result = i > 0 ? errors.slice(0, i) : [];
1092
+ const overLimit = fullLength - max + 1;
1093
+ const error = errors[i++];
1094
+ result.push(Object.assign(Object.assign({}, error), { details: error.details.split('\n').slice(0, -overLimit).join('\n'), filteredDetails: overLimit }));
1095
+ filtered = errors.length - i;
1096
+ for (; i < errors.length; i++) {
1097
+ const error = errors[i];
1098
+ if (typeof error === 'string' || !error.details)
1099
+ result.push(error);
1100
+ result.push(Object.assign(Object.assign({}, error), { details: '' }));
1101
+ }
1102
+ break;
1103
+ }
1104
+ else if (fullLength === max) {
1105
+ result = errors.slice(0, ++i);
1106
+ filtered = errors.length - i;
1107
+ for (; i < errors.length; i++) {
1108
+ const error = errors[i];
1109
+ if (typeof error === 'string' || !error.details)
1110
+ result.push(error);
1111
+ result.push(Object.assign(Object.assign({}, error), { details: '' }));
1112
+ }
1113
+ break;
1114
+ }
1115
+ }
1116
+ }
1117
+ return [result, filtered];
1118
+ };
1119
+ const assetGroup = (children, assets) => {
1120
+ let size = 0;
1121
+ for (const asset of children) {
1122
+ size += asset.size;
1123
+ }
1124
+ return {
1125
+ size,
1126
+ };
1127
+ };
1128
+ const moduleGroup = (children, modules) => {
1129
+ let size = 0;
1130
+ const sizes = {};
1131
+ for (const module of children) {
1132
+ size += module.size;
1133
+ for (const key of Object.keys(module.sizes)) {
1134
+ sizes[key] = (sizes[key] || 0) + module.sizes[key];
1135
+ }
1136
+ }
1137
+ return {
1138
+ size,
1139
+ sizes,
1140
+ };
1141
+ };
1142
+ const reasonGroup = (children, reasons) => {
1143
+ let active = false;
1144
+ for (const reason of children) {
1145
+ active = active || reason.active;
1146
+ }
1147
+ return {
1148
+ active,
1149
+ };
1150
+ };
1151
+ const GROUP_EXTENSION_REGEXP = /(\.[^.]+?)(?:\?|(?: \+ \d+ modules?)?$)/;
1152
+ const GROUP_PATH_REGEXP = /(.+)[/\\][^/\\]+?(?:\?|(?: \+ \d+ modules?)?$)/;
1153
+ const ASSETS_GROUPERS = {
1154
+ _: (groupConfigs, context, options) => {
1155
+ const groupByFlag = (name, exclude) => {
1156
+ groupConfigs.push({
1157
+ getKeys: asset => asset[name] ? ['1'] : undefined,
1158
+ getOptions: () => ({
1159
+ groupChildren: !exclude,
1160
+ force: exclude,
1161
+ }),
1162
+ createGroup: (key, children, assets) => exclude
1163
+ ? Object.assign({ type: 'assets by status', [name]: !!key, filteredChildren: assets.length }, assetGroup(children, assets)) : Object.assign({ type: 'assets by status', [name]: !!key, children }, assetGroup(children, assets)),
1164
+ });
1165
+ };
1166
+ const { groupAssetsByEmitStatus, groupAssetsByPath, groupAssetsByExtension } = options;
1167
+ if (groupAssetsByEmitStatus) {
1168
+ groupByFlag('emitted');
1169
+ groupByFlag('comparedForEmit');
1170
+ groupByFlag('isOverSizeLimit');
1171
+ }
1172
+ if (groupAssetsByEmitStatus || !options.cachedAssets) {
1173
+ groupByFlag('cached', !options.cachedAssets);
1174
+ }
1175
+ if (groupAssetsByPath || groupAssetsByExtension) {
1176
+ groupConfigs.push({
1177
+ getKeys: asset => {
1178
+ const extensionMatch = groupAssetsByExtension && GROUP_EXTENSION_REGEXP.exec(asset.name);
1179
+ const extension = extensionMatch ? extensionMatch[1] : '';
1180
+ const pathMatch = groupAssetsByPath && GROUP_PATH_REGEXP.exec(asset.name);
1181
+ const path = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
1182
+ const keys = [];
1183
+ if (groupAssetsByPath) {
1184
+ keys.push('.');
1185
+ if (extension)
1186
+ keys.push(path.length ? `${path.join('/')}/*${extension}` : `*${extension}`);
1187
+ while (path.length > 0) {
1188
+ keys.push(`${path.join('/')}/`);
1189
+ path.pop();
1190
+ }
1191
+ }
1192
+ else if (extension)
1193
+ keys.push(`*${extension}`);
1194
+ return keys;
1195
+ },
1196
+ createGroup: (key, children, assets) => (Object.assign({ type: groupAssetsByPath ? 'assets by path' : 'assets by extension', name: key, children }, assetGroup(children, assets))),
1197
+ });
1198
+ }
1199
+ },
1200
+ groupAssetsByInfo: (groupConfigs, context, options) => {
1201
+ const groupByAssetInfoFlag = name => {
1202
+ groupConfigs.push({
1203
+ getKeys: asset => { var _a; return ((_a = asset.info) === null || _a === void 0 ? void 0 : _a[name]) ? ['1'] : undefined; },
1204
+ createGroup: (key, children, assets) => (Object.assign({ type: 'assets by info', info: {
1205
+ [name]: !!key,
1206
+ }, children }, assetGroup(children, assets))),
1207
+ });
1208
+ };
1209
+ groupByAssetInfoFlag('immutable');
1210
+ groupByAssetInfoFlag('development');
1211
+ groupByAssetInfoFlag('hotModuleReplacement');
1212
+ },
1213
+ groupAssetsByChunk: (groupConfigs, context, options) => {
1214
+ const groupByNames = name => {
1215
+ groupConfigs.push({
1216
+ getKeys: asset => asset[name],
1217
+ createGroup: (key, children, assets) => (Object.assign({ type: 'assets by chunk', [name]: [key], children }, assetGroup(children, assets))),
1218
+ });
1219
+ };
1220
+ groupByNames('chunkNames');
1221
+ groupByNames('auxiliaryChunkNames');
1222
+ groupByNames('chunkIdHints');
1223
+ groupByNames('auxiliaryChunkIdHints');
1224
+ },
1225
+ excludeAssets: (groupConfigs, context, { excludeAssets }) => {
1226
+ groupConfigs.push({
1227
+ getKeys: asset => {
1228
+ const ident = asset.name;
1229
+ const excluded = excludeAssets.some(fn => fn(ident, asset));
1230
+ if (excluded)
1231
+ return ['excluded'];
1232
+ },
1233
+ getOptions: () => ({
1234
+ groupChildren: false,
1235
+ force: true,
1236
+ }),
1237
+ createGroup: (key, children, assets) => (Object.assign({ type: 'hidden assets', filteredChildren: assets.length }, assetGroup(children, assets))),
1238
+ });
1239
+ },
1240
+ };
1241
+ const MODULES_GROUPERS = type => ({
1242
+ _: (groupConfigs, context, options) => {
1243
+ const groupByFlag = (name, type, exclude) => {
1244
+ groupConfigs.push({
1245
+ getKeys: module => module[name] ? ['1'] : undefined,
1246
+ getOptions: () => ({
1247
+ groupChildren: !exclude,
1248
+ force: exclude,
1249
+ }),
1250
+ createGroup: (key, children, modules) => (Object.assign(Object.assign({ type, [name]: !!key }, (exclude ? { filteredChildren: modules.length } : { children })), moduleGroup(children, modules))),
1251
+ });
1252
+ };
1253
+ const { groupModulesByCacheStatus, groupModulesByLayer, groupModulesByAttributes, groupModulesByType, groupModulesByPath, groupModulesByExtension, } = options;
1254
+ if (groupModulesByAttributes) {
1255
+ groupByFlag('errors', 'modules with errors');
1256
+ groupByFlag('warnings', 'modules with warnings');
1257
+ groupByFlag('assets', 'modules with assets');
1258
+ groupByFlag('optional', 'optional modules');
1259
+ }
1260
+ if (groupModulesByCacheStatus) {
1261
+ groupByFlag('cacheable', 'cacheable modules');
1262
+ groupByFlag('built', 'built modules');
1263
+ groupByFlag('codeGenerated', 'code generated modules');
1264
+ }
1265
+ if (groupModulesByCacheStatus || !options.cachedModules) {
1266
+ groupByFlag('cached', 'cached modules', !options.cachedModules);
1267
+ }
1268
+ if (groupModulesByAttributes || !options.orphanModules) {
1269
+ groupByFlag('orphan', 'orphan modules', !options.orphanModules);
1270
+ }
1271
+ if (groupModulesByAttributes || !options.dependentModules) {
1272
+ groupByFlag('dependent', 'dependent modules', !options.dependentModules);
1273
+ }
1274
+ if (groupModulesByType || !options.runtimeModules) {
1275
+ groupConfigs.push({
1276
+ getKeys: module => {
1277
+ if (!module.moduleType)
1278
+ return;
1279
+ if (groupModulesByType) {
1280
+ return [module.moduleType.split('/', 1)[0]];
1281
+ }
1282
+ if (module.moduleType === ModuleTypeConstants_1.WEBPACK_MODULE_TYPE_RUNTIME) {
1283
+ return [ModuleTypeConstants_1.WEBPACK_MODULE_TYPE_RUNTIME];
1284
+ }
1285
+ },
1286
+ getOptions: key => {
1287
+ const exclude = key === ModuleTypeConstants_1.WEBPACK_MODULE_TYPE_RUNTIME && !options.runtimeModules;
1288
+ return {
1289
+ groupChildren: !exclude,
1290
+ force: exclude,
1291
+ };
1292
+ },
1293
+ createGroup: (key, children, modules) => {
1294
+ const exclude = key === ModuleTypeConstants_1.WEBPACK_MODULE_TYPE_RUNTIME && !options.runtimeModules;
1295
+ return Object.assign(Object.assign({ type: `${key} modules`, moduleType: key }, (exclude ? { filteredChildren: modules.length } : { children })), moduleGroup(children, modules));
1296
+ },
1297
+ });
1298
+ }
1299
+ if (groupModulesByLayer) {
1300
+ groupConfigs.push({
1301
+ getKeys: module => [module.layer],
1302
+ createGroup: (key, children, modules) => (Object.assign({ type: 'modules by layer', layer: key, children }, moduleGroup(children, modules))),
1303
+ });
1304
+ }
1305
+ if (groupModulesByPath || groupModulesByExtension) {
1306
+ groupConfigs.push({
1307
+ getKeys: module => {
1308
+ if (!module.name)
1309
+ return;
1310
+ const resource = (0, identifier_1.parseResource)(module.name.split('!').pop()).path;
1311
+ const dataUrl = /^data:[^,;]+/.exec(resource);
1312
+ if (dataUrl)
1313
+ return [dataUrl[0]];
1314
+ const extensionMatch = groupModulesByExtension && GROUP_EXTENSION_REGEXP.exec(resource);
1315
+ const extension = extensionMatch ? extensionMatch[1] : '';
1316
+ const pathMatch = groupModulesByPath && GROUP_PATH_REGEXP.exec(resource);
1317
+ const path = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
1318
+ const keys = [];
1319
+ if (groupModulesByPath) {
1320
+ if (extension)
1321
+ keys.push(path.length ? `${path.join('/')}/*${extension}` : `*${extension}`);
1322
+ while (path.length > 0) {
1323
+ keys.push(`${path.join('/')}/`);
1324
+ path.pop();
1325
+ }
1326
+ }
1327
+ else if (extension)
1328
+ keys.push(`*${extension}`);
1329
+ return keys;
1330
+ },
1331
+ createGroup: (key, children, modules) => {
1332
+ const isDataUrl = key.startsWith('data:');
1333
+ return Object.assign({ type: isDataUrl
1334
+ ? 'modules by mime type'
1335
+ : groupModulesByPath
1336
+ ? 'modules by path'
1337
+ : 'modules by extension', name: isDataUrl ? key.slice(/* 'data:'.length */ 5) : key, children }, moduleGroup(children, modules));
1338
+ },
1339
+ });
1340
+ }
1341
+ },
1342
+ excludeModules: (groupConfigs, context, { excludeModules }) => {
1343
+ groupConfigs.push({
1344
+ getKeys: module => {
1345
+ const name = module.name;
1346
+ if (name) {
1347
+ const excluded = excludeModules.some(fn => fn(name, module, type));
1348
+ if (excluded)
1349
+ return ['1'];
1350
+ }
1351
+ },
1352
+ getOptions: () => ({
1353
+ groupChildren: false,
1354
+ force: true,
1355
+ }),
1356
+ createGroup: (key, children, modules) => (Object.assign({ type: 'hidden modules', filteredChildren: children.length }, moduleGroup(children, modules))),
1357
+ });
1358
+ },
1359
+ });
1360
+ const RESULT_GROUPERS = {
1361
+ 'compilation.assets': ASSETS_GROUPERS,
1362
+ 'asset.related': ASSETS_GROUPERS,
1363
+ 'compilation.modules': MODULES_GROUPERS('module'),
1364
+ 'chunk.modules': MODULES_GROUPERS('chunk'),
1365
+ 'chunk.rootModules': MODULES_GROUPERS('root-of-chunk'),
1366
+ 'module.modules': MODULES_GROUPERS('nested'),
1367
+ 'module.reasons': {
1368
+ groupReasonsByOrigin: groupConfigs => {
1369
+ groupConfigs.push({
1370
+ getKeys: reason => [reason.module],
1371
+ createGroup: (key, children, reasons) => (Object.assign({ type: 'from origin', module: key, children }, reasonGroup(children, reasons))),
1372
+ });
1373
+ },
1374
+ },
1375
+ };
1376
+ // remove a prefixed "!" that can be specified to reverse sort order
1377
+ const normalizeFieldKey = field => {
1378
+ if (field[0] === '!') {
1379
+ return field.slice(1);
1380
+ }
1381
+ return field;
1382
+ };
1383
+ // if a field is prefixed by a "!" reverse sort order
1384
+ const sortOrderRegular = field => {
1385
+ if (field[0] === '!') {
1386
+ return false;
1387
+ }
1388
+ return true;
1389
+ };
1390
+ const sortByField = (field) => {
1391
+ if (!field) {
1392
+ const noSort = (a, b) => 0;
1393
+ return noSort;
1394
+ }
1395
+ const fieldKey = normalizeFieldKey(field);
1396
+ let sortFn = (0, comparators_1.compareSelect)(m => m[fieldKey], comparators_1.compareIds);
1397
+ // if a field is prefixed with a "!" the sort is reversed!
1398
+ const sortIsRegular = sortOrderRegular(field);
1399
+ if (!sortIsRegular) {
1400
+ const oldSortFn = sortFn;
1401
+ sortFn = (a, b) => oldSortFn(b, a);
1402
+ }
1403
+ return sortFn;
1404
+ };
1405
+ const ASSET_SORTERS = {
1406
+ assetsSort: (comparators, context, { assetsSort }) => {
1407
+ comparators.push(sortByField(assetsSort));
1408
+ },
1409
+ _: comparators => {
1410
+ comparators.push((0, comparators_1.compareSelect)(a => a.name, comparators_1.compareIds));
1411
+ },
1412
+ };
1413
+ const RESULT_SORTERS = {
1414
+ 'compilation.chunks': {
1415
+ chunksSort: (comparators, context, { chunksSort }) => {
1416
+ comparators.push(sortByField(chunksSort));
1417
+ },
1418
+ },
1419
+ 'compilation.modules': {
1420
+ modulesSort: (comparators, context, { modulesSort }) => {
1421
+ comparators.push(sortByField(modulesSort));
1422
+ },
1423
+ },
1424
+ 'chunk.modules': {
1425
+ chunkModulesSort: (comparators, context, { chunkModulesSort }) => {
1426
+ comparators.push(sortByField(chunkModulesSort));
1427
+ },
1428
+ },
1429
+ 'module.modules': {
1430
+ nestedModulesSort: (comparators, context, { nestedModulesSort }) => {
1431
+ comparators.push(sortByField(nestedModulesSort));
1432
+ },
1433
+ },
1434
+ 'compilation.assets': ASSET_SORTERS,
1435
+ 'asset.related': ASSET_SORTERS,
1436
+ };
1437
+ const iterateConfig = (config, options, fn) => {
1438
+ for (const hookFor of Object.keys(config)) {
1439
+ const subConfig = config[hookFor];
1440
+ for (const option of Object.keys(subConfig)) {
1441
+ if (option !== '_') {
1442
+ if (option.startsWith('!')) {
1443
+ if (options[option.slice(1)])
1444
+ continue;
1445
+ }
1446
+ else {
1447
+ const value = options[option];
1448
+ if (value === false ||
1449
+ value === undefined ||
1450
+ (Array.isArray(value) && value.length === 0))
1451
+ continue;
1452
+ }
1453
+ }
1454
+ fn(hookFor, subConfig[option]);
1455
+ }
1456
+ }
1457
+ };
1458
+ const ITEM_NAMES = {
1459
+ 'compilation.children[]': 'compilation',
1460
+ 'compilation.modules[]': 'module',
1461
+ 'compilation.entrypoints[]': 'chunkGroup',
1462
+ 'compilation.namedChunkGroups[]': 'chunkGroup',
1463
+ 'compilation.errors[]': 'error',
1464
+ 'compilation.warnings[]': 'warning',
1465
+ 'chunk.modules[]': 'module',
1466
+ 'chunk.rootModules[]': 'module',
1467
+ 'chunk.origins[]': 'chunkOrigin',
1468
+ 'compilation.chunks[]': 'chunk',
1469
+ 'compilation.assets[]': 'asset',
1470
+ 'asset.related[]': 'asset',
1471
+ 'module.issuerPath[]': 'moduleIssuer',
1472
+ 'module.reasons[]': 'moduleReason',
1473
+ 'module.modules[]': 'module',
1474
+ 'module.children[]': 'module',
1475
+ 'moduleTrace[]': 'moduleTraceItem',
1476
+ 'moduleTraceItem.dependencies[]': 'moduleTraceDependency',
1477
+ };
1478
+ const mergeToObject = (items) => {
1479
+ const obj = Object.create(null);
1480
+ for (const item of items) {
1481
+ obj[item.name] = item;
1482
+ }
1483
+ return obj;
1484
+ };
1485
+ const MERGER = {
1486
+ 'compilation.entrypoints': mergeToObject,
1487
+ 'compilation.namedChunkGroups': mergeToObject,
1488
+ };
1489
+ class DefaultStatsFactoryPlugin {
1490
+ apply(compiler) {
1491
+ compiler.hooks.compilation.tap('DefaultStatsFactoryPlugin', compilation => {
1492
+ compilation.hooks.statsFactory.tap('DefaultStatsFactoryPlugin', (stats, options, context) => {
1493
+ iterateConfig(SIMPLE_EXTRACTORS, options, (hookFor, fn) => {
1494
+ stats.hooks.extract
1495
+ .for(hookFor)
1496
+ .tap('DefaultStatsFactoryPlugin', (obj, data, ctx) => fn(obj, data, ctx, options, stats));
1497
+ });
1498
+ iterateConfig(FILTER, options, (hookFor, fn) => {
1499
+ stats.hooks.filter
1500
+ .for(hookFor)
1501
+ .tap('DefaultStatsFactoryPlugin', (item, ctx, idx, i) => fn(item, ctx, options, idx, i));
1502
+ });
1503
+ iterateConfig(FILTER_RESULTS, options, (hookFor, fn) => {
1504
+ stats.hooks.filterResults
1505
+ .for(hookFor)
1506
+ .tap('DefaultStatsFactoryPlugin', (item, ctx, idx, i) => fn(item, ctx, options, idx, i));
1507
+ });
1508
+ iterateConfig(SORTERS, options, (hookFor, fn) => {
1509
+ stats.hooks.sort
1510
+ .for(hookFor)
1511
+ .tap('DefaultStatsFactoryPlugin', (comparators, ctx) => fn(comparators, ctx, options));
1512
+ });
1513
+ iterateConfig(RESULT_SORTERS, options, (hookFor, fn) => {
1514
+ stats.hooks.sortResults
1515
+ .for(hookFor)
1516
+ .tap('DefaultStatsFactoryPlugin', (comparators, ctx) => fn(comparators, ctx, options));
1517
+ });
1518
+ iterateConfig(RESULT_GROUPERS, options, (hookFor, fn) => {
1519
+ stats.hooks.groupResults
1520
+ .for(hookFor)
1521
+ .tap('DefaultStatsFactoryPlugin', (groupConfigs, ctx) => fn(groupConfigs, ctx, options));
1522
+ });
1523
+ for (const key of Object.keys(ITEM_NAMES)) {
1524
+ const itemName = ITEM_NAMES[key];
1525
+ stats.hooks.getItemName.for(key).tap('DefaultStatsFactoryPlugin', () => itemName);
1526
+ }
1527
+ for (const key of Object.keys(MERGER)) {
1528
+ const merger = MERGER[key];
1529
+ stats.hooks.merge.for(key).tap('DefaultStatsFactoryPlugin', merger);
1530
+ }
1531
+ if (options.children) {
1532
+ if (Array.isArray(options.children)) {
1533
+ stats.hooks.getItemFactory
1534
+ .for('compilation.children[].compilation')
1535
+ .tap('DefaultStatsFactoryPlugin', (comp, { _index: idx }) => {
1536
+ if (idx < options.children.length) {
1537
+ return compilation.createStatsFactory(compilation.createStatsOptions(options.children[idx], context));
1538
+ }
1539
+ });
1540
+ }
1541
+ else if (options.children !== true) {
1542
+ const childFactory = compilation.createStatsFactory(compilation.createStatsOptions(options.children, context));
1543
+ stats.hooks.getItemFactory
1544
+ .for('compilation.children[].compilation')
1545
+ .tap('DefaultStatsFactoryPlugin', () => childFactory);
1546
+ }
1547
+ }
1548
+ });
1549
+ });
1550
+ }
1551
+ }
1552
+ exports.default = DefaultStatsFactoryPlugin;