webpack 5.93.0 → 5.95.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 (344) hide show
  1. package/README.md +8 -5
  2. package/bin/webpack.js +6 -7
  3. package/hot/log.js +1 -2
  4. package/hot/only-dev-server.js +1 -1
  5. package/hot/poll.js +1 -1
  6. package/hot/signal.js +1 -1
  7. package/lib/APIPlugin.js +4 -3
  8. package/lib/AbstractMethodError.js +10 -5
  9. package/lib/AutomaticPrefetchPlugin.js +1 -1
  10. package/lib/BannerPlugin.js +12 -6
  11. package/lib/Cache.js +8 -10
  12. package/lib/CacheFacade.js +3 -3
  13. package/lib/CaseSensitiveModulesWarning.js +5 -7
  14. package/lib/Chunk.js +14 -11
  15. package/lib/ChunkGraph.js +58 -36
  16. package/lib/ChunkGroup.js +2 -3
  17. package/lib/ChunkTemplate.js +43 -0
  18. package/lib/CleanPlugin.js +10 -11
  19. package/lib/CodeGenerationResults.js +6 -5
  20. package/lib/CommentCompilationWarning.js +0 -1
  21. package/lib/Compilation.js +223 -191
  22. package/lib/Compiler.js +81 -82
  23. package/lib/ConcatenationScope.js +3 -6
  24. package/lib/ConditionalInitFragment.js +6 -7
  25. package/lib/ConstPlugin.js +7 -15
  26. package/lib/ContextExclusionPlugin.js +3 -3
  27. package/lib/ContextModule.js +33 -20
  28. package/lib/ContextModuleFactory.js +89 -44
  29. package/lib/ContextReplacementPlugin.js +10 -9
  30. package/lib/DefinePlugin.js +75 -68
  31. package/lib/DelegatedModule.js +7 -3
  32. package/lib/DelegatedModuleFactoryPlugin.js +36 -22
  33. package/lib/DelegatedPlugin.js +4 -0
  34. package/lib/DependenciesBlock.js +0 -1
  35. package/lib/Dependency.js +10 -14
  36. package/lib/DllEntryPlugin.js +4 -2
  37. package/lib/DllModuleFactory.js +1 -0
  38. package/lib/DllPlugin.js +9 -7
  39. package/lib/DllReferencePlugin.js +30 -15
  40. package/lib/EntryPlugin.js +1 -3
  41. package/lib/EnvironmentPlugin.js +6 -2
  42. package/lib/ErrorHelpers.js +11 -12
  43. package/lib/EvalDevToolModulePlugin.js +10 -12
  44. package/lib/EvalSourceMapDevToolPlugin.js +15 -13
  45. package/lib/ExportsInfo.js +185 -120
  46. package/lib/ExternalModule.js +41 -15
  47. package/lib/ExternalModuleFactoryPlugin.js +23 -10
  48. package/lib/FileSystemInfo.js +791 -422
  49. package/lib/FlagAllModulesAsUsedPlugin.js +1 -1
  50. package/lib/FlagDependencyExportsPlugin.js +12 -11
  51. package/lib/FlagDependencyUsagePlugin.js +1 -1
  52. package/lib/Generator.js +2 -5
  53. package/lib/GraphHelpers.js +3 -2
  54. package/lib/HookWebpackError.js +8 -10
  55. package/lib/HotModuleReplacementPlugin.js +78 -64
  56. package/lib/IgnoreErrorModuleFactory.js +3 -3
  57. package/lib/IgnorePlugin.js +1 -3
  58. package/lib/IgnoreWarningsPlugin.js +6 -9
  59. package/lib/InitFragment.js +2 -3
  60. package/lib/LibManifestPlugin.js +4 -3
  61. package/lib/MainTemplate.js +72 -19
  62. package/lib/Module.js +25 -9
  63. package/lib/ModuleBuildError.js +4 -11
  64. package/lib/ModuleDependencyError.js +5 -5
  65. package/lib/ModuleDependencyWarning.js +5 -5
  66. package/lib/ModuleError.js +1 -5
  67. package/lib/ModuleFilenameHelpers.js +29 -46
  68. package/lib/ModuleGraph.js +7 -6
  69. package/lib/ModuleGraphConnection.js +6 -6
  70. package/lib/ModuleInfoHeaderPlugin.js +82 -30
  71. package/lib/ModuleParseError.js +8 -9
  72. package/lib/ModuleRestoreError.js +1 -1
  73. package/lib/ModuleStoreError.js +1 -1
  74. package/lib/ModuleTemplate.js +33 -1
  75. package/lib/ModuleTypeConstants.js +21 -22
  76. package/lib/ModuleWarning.js +1 -5
  77. package/lib/MultiCompiler.js +24 -26
  78. package/lib/MultiStats.js +73 -31
  79. package/lib/MultiWatching.js +1 -1
  80. package/lib/NormalModule.js +130 -69
  81. package/lib/NormalModuleFactory.js +53 -49
  82. package/lib/OptimizationStages.js +3 -3
  83. package/lib/ProgressPlugin.js +9 -9
  84. package/lib/ProvidePlugin.js +4 -4
  85. package/lib/RuntimeGlobals.js +71 -70
  86. package/lib/RuntimeModule.js +1 -1
  87. package/lib/RuntimePlugin.js +24 -12
  88. package/lib/RuntimeTemplate.js +40 -44
  89. package/lib/SizeFormatHelpers.js +2 -4
  90. package/lib/SourceMapDevToolPlugin.js +42 -34
  91. package/lib/Stats.js +5 -11
  92. package/lib/Template.js +18 -24
  93. package/lib/TemplatedPathPlugin.js +21 -13
  94. package/lib/WarnDeprecatedOptionPlugin.js +0 -1
  95. package/lib/WatchIgnorePlugin.js +26 -9
  96. package/lib/Watching.js +10 -5
  97. package/lib/WebpackOptionsApply.js +84 -62
  98. package/lib/asset/AssetGenerator.js +107 -42
  99. package/lib/asset/AssetModulesPlugin.js +29 -23
  100. package/lib/asset/AssetSourceGenerator.js +2 -7
  101. package/lib/async-modules/AwaitDependenciesInitFragment.js +6 -7
  102. package/lib/buildChunkGraph.js +93 -81
  103. package/lib/cache/IdleFileCachePlugin.js +4 -4
  104. package/lib/cache/MemoryWithGcCachePlugin.js +5 -5
  105. package/lib/cache/PackFileCacheStrategy.js +51 -50
  106. package/lib/cache/ResolverCachePlugin.js +6 -6
  107. package/lib/cache/mergeEtags.js +16 -21
  108. package/lib/cli.js +148 -104
  109. package/lib/config/browserslistTargetHandler.js +16 -13
  110. package/lib/config/defaults.js +32 -28
  111. package/lib/config/normalization.js +335 -344
  112. package/lib/config/target.js +42 -52
  113. package/lib/container/ContainerEntryModule.js +2 -2
  114. package/lib/container/ContainerPlugin.js +1 -1
  115. package/lib/container/RemoteRuntimeModule.js +11 -8
  116. package/lib/container/options.js +18 -4
  117. package/lib/css/CssExportsGenerator.js +26 -24
  118. package/lib/css/CssGenerator.js +9 -4
  119. package/lib/css/CssLoadingRuntimeModule.js +10 -10
  120. package/lib/css/CssModulesPlugin.js +127 -47
  121. package/lib/css/CssParser.js +20 -18
  122. package/lib/css/walkCssTokens.js +80 -95
  123. package/lib/debug/ProfilingPlugin.js +19 -20
  124. package/lib/dependencies/AMDDefineDependency.js +1 -1
  125. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +83 -47
  126. package/lib/dependencies/AMDRequireArrayDependency.js +9 -10
  127. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +22 -16
  128. package/lib/dependencies/AMDRuntimeModules.js +2 -2
  129. package/lib/dependencies/CommonJsDependencyHelpers.js +6 -2
  130. package/lib/dependencies/CommonJsExportRequireDependency.js +37 -41
  131. package/lib/dependencies/CommonJsExportsDependency.js +0 -1
  132. package/lib/dependencies/CommonJsExportsParserPlugin.js +19 -23
  133. package/lib/dependencies/CommonJsFullRequireDependency.js +1 -1
  134. package/lib/dependencies/CommonJsImportsParserPlugin.js +52 -61
  135. package/lib/dependencies/CommonJsSelfReferenceDependency.js +6 -8
  136. package/lib/dependencies/ConstDependency.js +1 -1
  137. package/lib/dependencies/ContextDependency.js +7 -2
  138. package/lib/dependencies/ContextDependencyHelpers.js +31 -34
  139. package/lib/dependencies/ContextElementDependency.js +35 -8
  140. package/lib/dependencies/CriticalDependencyWarning.js +1 -1
  141. package/lib/dependencies/CssExportDependency.js +7 -7
  142. package/lib/dependencies/CssImportDependency.js +0 -2
  143. package/lib/dependencies/CssLocalIdentifierDependency.js +3 -3
  144. package/lib/dependencies/CssSelfLocalIdentifierDependency.js +2 -1
  145. package/lib/dependencies/CssUrlDependency.js +4 -5
  146. package/lib/dependencies/DynamicExports.js +5 -5
  147. package/lib/dependencies/ExportsInfoDependency.js +1 -2
  148. package/lib/dependencies/HarmonyAcceptImportDependency.js +1 -1
  149. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +4 -5
  150. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +27 -16
  151. package/lib/dependencies/HarmonyExportExpressionDependency.js +1 -1
  152. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +107 -64
  153. package/lib/dependencies/HarmonyExports.js +2 -2
  154. package/lib/dependencies/HarmonyImportDependency.js +2 -4
  155. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +19 -4
  156. package/lib/dependencies/HarmonyImportSpecifierDependency.js +40 -15
  157. package/lib/dependencies/ImportDependency.js +1 -1
  158. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +5 -5
  159. package/lib/dependencies/ImportMetaPlugin.js +11 -13
  160. package/lib/dependencies/ImportParserPlugin.js +39 -44
  161. package/lib/dependencies/JsonExportsDependency.js +22 -18
  162. package/lib/dependencies/LoaderPlugin.js +47 -36
  163. package/lib/dependencies/LocalModule.js +1 -1
  164. package/lib/dependencies/LocalModulesHelpers.js +4 -4
  165. package/lib/dependencies/ModuleDecoratorDependency.js +1 -1
  166. package/lib/dependencies/ProvidedDependency.js +1 -1
  167. package/lib/dependencies/PureExpressionDependency.js +6 -6
  168. package/lib/dependencies/RequireContextDependencyParserPlugin.js +1 -1
  169. package/lib/dependencies/RuntimeRequirementsDependency.js +1 -1
  170. package/lib/dependencies/SystemPlugin.js +1 -1
  171. package/lib/dependencies/URLDependency.js +3 -3
  172. package/lib/dependencies/URLPlugin.js +66 -12
  173. package/lib/dependencies/WorkerPlugin.js +25 -24
  174. package/lib/dependencies/processExportInfo.js +3 -1
  175. package/lib/electron/ElectronTargetPlugin.js +1 -0
  176. package/lib/esm/ModuleChunkFormatPlugin.js +3 -3
  177. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +7 -3
  178. package/lib/formatLocation.js +1 -2
  179. package/lib/hmr/HotModuleReplacement.runtime.js +4 -5
  180. package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -0
  181. package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +9 -12
  182. package/lib/hmr/LazyCompilationPlugin.js +27 -12
  183. package/lib/hmr/lazyCompilationBackend.js +64 -40
  184. package/lib/ids/ChunkModuleIdRangePlugin.js +1 -3
  185. package/lib/ids/DeterministicChunkIdsPlugin.js +2 -4
  186. package/lib/ids/DeterministicModuleIdsPlugin.js +1 -1
  187. package/lib/ids/HashedModuleIdsPlugin.js +5 -1
  188. package/lib/ids/IdHelpers.js +29 -39
  189. package/lib/ids/SyncModuleIdsPlugin.js +7 -2
  190. package/lib/index.js +1 -5
  191. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +5 -4
  192. package/lib/javascript/BasicEvaluatedExpression.js +4 -19
  193. package/lib/javascript/ChunkHelpers.js +1 -1
  194. package/lib/javascript/CommonJsChunkFormatPlugin.js +3 -2
  195. package/lib/javascript/EnableChunkLoadingPlugin.js +7 -6
  196. package/lib/javascript/JavascriptGenerator.js +23 -7
  197. package/lib/javascript/JavascriptModulesPlugin.js +133 -86
  198. package/lib/javascript/JavascriptParser.js +179 -200
  199. package/lib/javascript/JavascriptParserHelpers.js +20 -21
  200. package/lib/javascript/StartupHelpers.js +41 -13
  201. package/lib/json/JsonGenerator.js +7 -13
  202. package/lib/json/JsonModulesPlugin.js +1 -4
  203. package/lib/json/JsonParser.js +5 -3
  204. package/lib/library/AmdLibraryPlugin.js +12 -16
  205. package/lib/library/AssignLibraryPlugin.js +8 -10
  206. package/lib/library/EnableLibraryPlugin.js +15 -14
  207. package/lib/library/JsonpLibraryPlugin.js +2 -1
  208. package/lib/library/ModernModuleLibraryPlugin.js +8 -6
  209. package/lib/library/ModuleLibraryPlugin.js +2 -1
  210. package/lib/library/SystemLibraryPlugin.js +2 -1
  211. package/lib/library/UmdLibraryPlugin.js +66 -92
  212. package/lib/logging/Logger.js +32 -4
  213. package/lib/logging/createConsoleLogger.js +12 -13
  214. package/lib/logging/runtime.js +7 -8
  215. package/lib/logging/truncateArgs.js +5 -8
  216. package/lib/node/NodeWatchFileSystem.js +3 -18
  217. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +2 -2
  218. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +1 -0
  219. package/lib/node/RequireChunkLoadingRuntimeModule.js +2 -2
  220. package/lib/node/nodeConsole.js +22 -22
  221. package/lib/optimize/AggressiveMergingPlugin.js +2 -4
  222. package/lib/optimize/AggressiveSplittingPlugin.js +16 -19
  223. package/lib/optimize/ConcatenatedModule.js +81 -51
  224. package/lib/optimize/EnsureChunkConditionsPlugin.js +1 -1
  225. package/lib/optimize/FlagIncludedChunksPlugin.js +3 -3
  226. package/lib/optimize/InnerGraph.js +17 -17
  227. package/lib/optimize/InnerGraphPlugin.js +8 -7
  228. package/lib/optimize/LimitChunkCountPlugin.js +2 -3
  229. package/lib/optimize/MangleExportsPlugin.js +1 -0
  230. package/lib/optimize/MergeDuplicateChunksPlugin.js +2 -2
  231. package/lib/optimize/MinMaxSizeWarning.js +1 -1
  232. package/lib/optimize/ModuleConcatenationPlugin.js +54 -78
  233. package/lib/optimize/RealContentHashPlugin.js +7 -10
  234. package/lib/optimize/RemoveParentModulesPlugin.js +3 -3
  235. package/lib/optimize/SideEffectsFlagPlugin.js +6 -2
  236. package/lib/optimize/SplitChunksPlugin.js +34 -30
  237. package/lib/performance/SizeLimitsPlugin.js +2 -2
  238. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +1 -1
  239. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +1 -1
  240. package/lib/rules/BasicEffectRulePlugin.js +3 -1
  241. package/lib/rules/BasicMatcherRulePlugin.js +3 -1
  242. package/lib/rules/ObjectMatcherRulePlugin.js +4 -1
  243. package/lib/rules/RuleSetCompiler.js +41 -22
  244. package/lib/rules/UseEffectRulePlugin.js +36 -32
  245. package/lib/runtime/AsyncModuleRuntimeModule.js +1 -1
  246. package/lib/runtime/AutoPublicPathRuntimeModule.js +8 -3
  247. package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +2 -2
  248. package/lib/runtime/DefinePropertyGettersRuntimeModule.js +1 -1
  249. package/lib/runtime/EnsureChunkRuntimeModule.js +10 -11
  250. package/lib/runtime/GetChunkFilenameRuntimeModule.js +11 -17
  251. package/lib/runtime/LoadScriptRuntimeModule.js +17 -18
  252. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +1 -3
  253. package/lib/schemes/DataUriPlugin.js +1 -1
  254. package/lib/schemes/HttpUriPlugin.js +241 -126
  255. package/lib/serialization/BinaryMiddleware.js +44 -28
  256. package/lib/serialization/DateObjectSerializer.js +1 -0
  257. package/lib/serialization/ErrorObjectSerializer.js +2 -0
  258. package/lib/serialization/FileMiddleware.js +154 -106
  259. package/lib/serialization/MapObjectSerializer.js +2 -1
  260. package/lib/serialization/NullPrototypeObjectSerializer.js +3 -2
  261. package/lib/serialization/ObjectMiddleware.js +52 -56
  262. package/lib/serialization/PlainObjectSerializer.js +32 -6
  263. package/lib/serialization/RegExpObjectSerializer.js +1 -0
  264. package/lib/serialization/Serializer.js +4 -5
  265. package/lib/serialization/SerializerMiddleware.js +6 -6
  266. package/lib/serialization/SetObjectSerializer.js +2 -1
  267. package/lib/sharing/ConsumeSharedPlugin.js +116 -97
  268. package/lib/sharing/ConsumeSharedRuntimeModule.js +4 -4
  269. package/lib/sharing/ProvideForSharedDependency.js +0 -1
  270. package/lib/sharing/ProvideSharedPlugin.js +2 -2
  271. package/lib/sharing/resolveMatchedConfigs.js +2 -1
  272. package/lib/sharing/utils.js +15 -27
  273. package/lib/stats/DefaultStatsFactoryPlugin.js +424 -281
  274. package/lib/stats/DefaultStatsPresetPlugin.js +73 -18
  275. package/lib/stats/DefaultStatsPrinterPlugin.js +370 -101
  276. package/lib/stats/StatsFactory.js +127 -56
  277. package/lib/stats/StatsPrinter.js +75 -44
  278. package/lib/util/ArrayHelpers.js +8 -4
  279. package/lib/util/ArrayQueue.js +1 -1
  280. package/lib/util/AsyncQueue.js +31 -12
  281. package/lib/util/IterableHelpers.js +3 -4
  282. package/lib/util/LazyBucketSortedSet.js +60 -44
  283. package/lib/util/LazySet.js +13 -0
  284. package/lib/util/MapHelpers.js +1 -3
  285. package/lib/util/ParallelismFactorCalculator.js +1 -1
  286. package/lib/util/Queue.js +1 -1
  287. package/lib/util/Semaphore.js +4 -7
  288. package/lib/util/SetHelpers.js +5 -5
  289. package/lib/util/SortableSet.js +4 -3
  290. package/lib/util/StackedCacheMap.js +4 -6
  291. package/lib/util/StackedMap.js +1 -3
  292. package/lib/util/StringXor.js +0 -5
  293. package/lib/util/TupleQueue.js +1 -1
  294. package/lib/util/TupleSet.js +15 -5
  295. package/lib/util/URLAbsoluteSpecifier.js +7 -7
  296. package/lib/util/WeakTupleMap.js +19 -21
  297. package/lib/util/binarySearchBounds.js +5 -12
  298. package/lib/util/chainedImports.js +1 -1
  299. package/lib/util/cleverMerge.js +21 -19
  300. package/lib/util/comparators.js +57 -52
  301. package/lib/util/compileBooleanMatcher.js +3 -6
  302. package/lib/util/conventions.js +8 -11
  303. package/lib/util/createHash.js +9 -6
  304. package/lib/util/deprecation.js +22 -12
  305. package/lib/util/deterministicGrouping.js +19 -26
  306. package/lib/util/findGraphRoots.js +2 -2
  307. package/lib/util/fs.js +32 -32
  308. package/lib/util/hash/md4.js +2 -2
  309. package/lib/util/hash/wasm-hash.js +7 -7
  310. package/lib/util/hash/xxhash64.js +2 -2
  311. package/lib/util/identifier.js +81 -59
  312. package/lib/util/memoize.js +8 -10
  313. package/lib/util/mergeScope.js +6 -9
  314. package/lib/util/nonNumericOnlyHash.js +2 -2
  315. package/lib/util/numberHash.js +1 -6
  316. package/lib/util/objectToMap.js +0 -1
  317. package/lib/util/propertyAccess.js +2 -5
  318. package/lib/util/propertyName.js +1 -3
  319. package/lib/util/registerExternalSerializer.js +1 -1
  320. package/lib/util/runtime.js +109 -113
  321. package/lib/util/semver.js +29 -27
  322. package/lib/util/serialization.js +16 -1
  323. package/lib/util/smartGrouping.js +5 -5
  324. package/lib/util/source.js +1 -1
  325. package/lib/wasm/EnableWasmLoadingPlugin.js +5 -4
  326. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +3 -3
  327. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +5 -6
  328. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +3 -3
  329. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +20 -19
  330. package/lib/wasm-sync/WebAssemblyGenerator.js +14 -29
  331. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +1 -1
  332. package/lib/wasm-sync/WebAssemblyUtils.js +2 -2
  333. package/lib/web/JsonpChunkLoadingRuntimeModule.js +2 -3
  334. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +3 -1
  335. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
  336. package/package.json +18 -17
  337. package/schemas/WebpackOptions.check.js +1 -1
  338. package/schemas/WebpackOptions.json +5 -0
  339. package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
  340. package/schemas/plugins/container/ContainerReferencePlugin.json +1 -0
  341. package/schemas/plugins/container/ExternalsType.check.js +1 -1
  342. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  343. package/schemas/plugins/container/ModuleFederationPlugin.json +1 -0
  344. package/types.d.ts +681 -355
@@ -19,7 +19,7 @@ const SortableSet = require("./SortableSet");
19
19
  * @param {EntryOptions=} options optionally already received entry options
20
20
  * @returns {RuntimeSpec} runtime
21
21
  */
22
- exports.getEntryRuntime = (compilation, name, options) => {
22
+ module.exports.getEntryRuntime = (compilation, name, options) => {
23
23
  let dependOn;
24
24
  let runtime;
25
25
  if (options) {
@@ -31,7 +31,7 @@ exports.getEntryRuntime = (compilation, name, options) => {
31
31
  }
32
32
  if (dependOn) {
33
33
  /** @type {RuntimeSpec} */
34
- let result = undefined;
34
+ let result;
35
35
  const queue = new Set(dependOn);
36
36
  for (const name of queue) {
37
37
  const dep = compilation.entries.get(name);
@@ -46,9 +46,8 @@ exports.getEntryRuntime = (compilation, name, options) => {
46
46
  }
47
47
  }
48
48
  return result || name;
49
- } else {
50
- return runtime || name;
51
49
  }
50
+ return runtime || name;
52
51
  };
53
52
 
54
53
  /**
@@ -69,7 +68,7 @@ const forEachRuntime = (runtime, fn, deterministicOrder = false) => {
69
68
  }
70
69
  }
71
70
  };
72
- exports.forEachRuntime = forEachRuntime;
71
+ module.exports.forEachRuntime = forEachRuntime;
73
72
 
74
73
  /**
75
74
  * @template T
@@ -90,19 +89,19 @@ const getRuntimeKey = runtime => {
90
89
  if (typeof runtime === "string") return runtime;
91
90
  return runtime.getFromUnorderedCache(getRuntimesKey);
92
91
  };
93
- exports.getRuntimeKey = getRuntimeKey;
92
+ module.exports.getRuntimeKey = getRuntimeKey;
94
93
 
95
94
  /**
96
95
  * @param {string} key key of runtimes
97
96
  * @returns {RuntimeSpec} runtime(s)
98
97
  */
99
98
  const keyToRuntime = key => {
100
- if (key === "*") return undefined;
99
+ if (key === "*") return;
101
100
  const items = key.split("\n");
102
101
  if (items.length === 1) return items[0];
103
102
  return new SortableSet(items);
104
103
  };
105
- exports.keyToRuntime = keyToRuntime;
104
+ module.exports.keyToRuntime = keyToRuntime;
106
105
 
107
106
  /**
108
107
  * @template T
@@ -123,13 +122,13 @@ const runtimeToString = runtime => {
123
122
  if (typeof runtime === "string") return runtime;
124
123
  return runtime.getFromUnorderedCache(getRuntimesString);
125
124
  };
126
- exports.runtimeToString = runtimeToString;
125
+ module.exports.runtimeToString = runtimeToString;
127
126
 
128
127
  /**
129
128
  * @param {RuntimeCondition} runtimeCondition runtime condition
130
129
  * @returns {string} readable version
131
130
  */
132
- exports.runtimeConditionToString = runtimeCondition => {
131
+ module.exports.runtimeConditionToString = runtimeCondition => {
133
132
  if (runtimeCondition === true) return "true";
134
133
  if (runtimeCondition === false) return "false";
135
134
  return runtimeToString(runtimeCondition);
@@ -152,40 +151,38 @@ const runtimeEqual = (a, b) => {
152
151
  return false;
153
152
  } else if (a.size !== b.size) {
154
153
  return false;
155
- } else {
156
- a.sort();
157
- b.sort();
158
- const aIt = a[Symbol.iterator]();
159
- const bIt = b[Symbol.iterator]();
160
- for (;;) {
161
- const aV = aIt.next();
162
- if (aV.done) return true;
163
- const bV = bIt.next();
164
- if (aV.value !== bV.value) return false;
165
- }
154
+ }
155
+ a.sort();
156
+ b.sort();
157
+ const aIt = a[Symbol.iterator]();
158
+ const bIt = b[Symbol.iterator]();
159
+ for (;;) {
160
+ const aV = aIt.next();
161
+ if (aV.done) return true;
162
+ const bV = bIt.next();
163
+ if (aV.value !== bV.value) return false;
166
164
  }
167
165
  };
168
- exports.runtimeEqual = runtimeEqual;
166
+ module.exports.runtimeEqual = runtimeEqual;
169
167
 
170
168
  /**
171
169
  * @param {RuntimeSpec} a first
172
170
  * @param {RuntimeSpec} b second
173
171
  * @returns {-1|0|1} compare
174
172
  */
175
- exports.compareRuntime = (a, b) => {
173
+ module.exports.compareRuntime = (a, b) => {
176
174
  if (a === b) {
177
175
  return 0;
178
176
  } else if (a === undefined) {
179
177
  return -1;
180
178
  } else if (b === undefined) {
181
179
  return 1;
182
- } else {
183
- const aKey = getRuntimeKey(a);
184
- const bKey = getRuntimeKey(b);
185
- if (aKey < bKey) return -1;
186
- if (aKey > bKey) return 1;
187
- return 0;
188
180
  }
181
+ const aKey = getRuntimeKey(a);
182
+ const bKey = getRuntimeKey(b);
183
+ if (aKey < bKey) return -1;
184
+ if (aKey > bKey) return 1;
185
+ return 0;
189
186
  };
190
187
 
191
188
  /**
@@ -208,26 +205,23 @@ const mergeRuntime = (a, b) => {
208
205
  return set;
209
206
  } else if (b.has(a)) {
210
207
  return b;
211
- } else {
212
- const set = new SortableSet(b);
213
- set.add(a);
214
- return set;
215
- }
216
- } else {
217
- if (typeof b === "string") {
218
- if (a.has(b)) return a;
219
- const set = new SortableSet(a);
220
- set.add(b);
221
- return set;
222
- } else {
223
- const set = new SortableSet(a);
224
- for (const item of b) set.add(item);
225
- if (set.size === a.size) return a;
226
- return set;
227
208
  }
209
+ const set = new SortableSet(b);
210
+ set.add(a);
211
+ return set;
212
+ }
213
+ if (typeof b === "string") {
214
+ if (a.has(b)) return a;
215
+ const set = new SortableSet(a);
216
+ set.add(b);
217
+ return set;
228
218
  }
219
+ const set = new SortableSet(a);
220
+ for (const item of b) set.add(item);
221
+ if (set.size === a.size) return a;
222
+ return set;
229
223
  };
230
- exports.mergeRuntime = mergeRuntime;
224
+ module.exports.mergeRuntime = mergeRuntime;
231
225
 
232
226
  /**
233
227
  * @param {RuntimeCondition} a first
@@ -235,12 +229,12 @@ exports.mergeRuntime = mergeRuntime;
235
229
  * @param {RuntimeSpec} runtime full runtime
236
230
  * @returns {RuntimeCondition} result
237
231
  */
238
- exports.mergeRuntimeCondition = (a, b, runtime) => {
232
+ module.exports.mergeRuntimeCondition = (a, b, runtime) => {
239
233
  if (a === false) return b;
240
234
  if (b === false) return a;
241
235
  if (a === true || b === true) return true;
242
236
  const merged = mergeRuntime(a, b);
243
- if (merged === undefined) return undefined;
237
+ if (merged === undefined) return;
244
238
  if (typeof merged === "string") {
245
239
  if (typeof runtime === "string" && merged === runtime) return true;
246
240
  return merged;
@@ -256,10 +250,10 @@ exports.mergeRuntimeCondition = (a, b, runtime) => {
256
250
  * @param {RuntimeSpec} runtime full runtime
257
251
  * @returns {RuntimeSpec | true} result
258
252
  */
259
- exports.mergeRuntimeConditionNonFalse = (a, b, runtime) => {
253
+ module.exports.mergeRuntimeConditionNonFalse = (a, b, runtime) => {
260
254
  if (a === true || b === true) return true;
261
255
  const merged = mergeRuntime(a, b);
262
- if (merged === undefined) return undefined;
256
+ if (merged === undefined) return;
263
257
  if (typeof merged === "string") {
264
258
  if (typeof runtime === "string" && merged === runtime) return true;
265
259
  return merged;
@@ -282,38 +276,34 @@ const mergeRuntimeOwned = (a, b) => {
282
276
  } else if (a === undefined) {
283
277
  if (typeof b === "string") {
284
278
  return b;
285
- } else {
286
- return new SortableSet(b);
287
279
  }
280
+ return new SortableSet(b);
288
281
  } else if (typeof a === "string") {
289
282
  if (typeof b === "string") {
290
283
  const set = new SortableSet();
291
284
  set.add(a);
292
285
  set.add(b);
293
286
  return set;
294
- } else {
295
- const set = new SortableSet(b);
296
- set.add(a);
297
- return set;
298
- }
299
- } else {
300
- if (typeof b === "string") {
301
- a.add(b);
302
- return a;
303
- } else {
304
- for (const item of b) a.add(item);
305
- return a;
306
287
  }
288
+ const set = new SortableSet(b);
289
+ set.add(a);
290
+ return set;
307
291
  }
292
+ if (typeof b === "string") {
293
+ a.add(b);
294
+ return a;
295
+ }
296
+ for (const item of b) a.add(item);
297
+ return a;
308
298
  };
309
- exports.mergeRuntimeOwned = mergeRuntimeOwned;
299
+ module.exports.mergeRuntimeOwned = mergeRuntimeOwned;
310
300
 
311
301
  /**
312
302
  * @param {RuntimeSpec} a first
313
303
  * @param {RuntimeSpec} b second
314
304
  * @returns {RuntimeSpec} merged
315
305
  */
316
- exports.intersectRuntime = (a, b) => {
306
+ module.exports.intersectRuntime = (a, b) => {
317
307
  if (a === undefined) {
318
308
  return b;
319
309
  } else if (b === undefined) {
@@ -322,26 +312,26 @@ exports.intersectRuntime = (a, b) => {
322
312
  return a;
323
313
  } else if (typeof a === "string") {
324
314
  if (typeof b === "string") {
325
- return undefined;
315
+ return;
326
316
  } else if (b.has(a)) {
327
317
  return a;
328
- } else {
329
- return undefined;
330
- }
331
- } else {
332
- if (typeof b === "string") {
333
- if (a.has(b)) return b;
334
- return undefined;
335
- } else {
336
- const set = new SortableSet();
337
- for (const item of b) {
338
- if (a.has(item)) set.add(item);
339
- }
340
- if (set.size === 0) return undefined;
341
- if (set.size === 1) for (const item of set) return item;
342
- return set;
343
318
  }
319
+ return;
320
+ }
321
+ if (typeof b === "string") {
322
+ if (a.has(b)) return b;
323
+ return;
344
324
  }
325
+ const set = new SortableSet();
326
+ for (const item of b) {
327
+ if (a.has(item)) set.add(item);
328
+ }
329
+ if (set.size === 0) return;
330
+ if (set.size === 1) {
331
+ const [item] = set;
332
+ return item;
333
+ }
334
+ return set;
345
335
  };
346
336
 
347
337
  /**
@@ -351,42 +341,42 @@ exports.intersectRuntime = (a, b) => {
351
341
  */
352
342
  const subtractRuntime = (a, b) => {
353
343
  if (a === undefined) {
354
- return undefined;
344
+ return;
355
345
  } else if (b === undefined) {
356
346
  return a;
357
347
  } else if (a === b) {
358
- return undefined;
348
+ return;
359
349
  } else if (typeof a === "string") {
360
350
  if (typeof b === "string") {
361
351
  return a;
362
352
  } else if (b.has(a)) {
363
- return undefined;
364
- } else {
365
- return a;
353
+ return;
366
354
  }
367
- } else {
368
- if (typeof b === "string") {
369
- if (!a.has(b)) return a;
370
- if (a.size === 2) {
371
- for (const item of a) {
372
- if (item !== b) return item;
373
- }
374
- }
375
- const set = new SortableSet(a);
376
- set.delete(b);
377
- return set;
378
- } else {
379
- const set = new SortableSet();
355
+ return a;
356
+ }
357
+ if (typeof b === "string") {
358
+ if (!a.has(b)) return a;
359
+ if (a.size === 2) {
380
360
  for (const item of a) {
381
- if (!b.has(item)) set.add(item);
361
+ if (item !== b) return item;
382
362
  }
383
- if (set.size === 0) return undefined;
384
- if (set.size === 1) for (const item of set) return item;
385
- return set;
386
363
  }
364
+ const set = new SortableSet(a);
365
+ set.delete(b);
366
+ return set;
387
367
  }
368
+ const set = new SortableSet();
369
+ for (const item of a) {
370
+ if (!b.has(item)) set.add(item);
371
+ }
372
+ if (set.size === 0) return;
373
+ if (set.size === 1) {
374
+ const [item] = set;
375
+ return item;
376
+ }
377
+ return set;
388
378
  };
389
- exports.subtractRuntime = subtractRuntime;
379
+ module.exports.subtractRuntime = subtractRuntime;
390
380
 
391
381
  /**
392
382
  * @param {RuntimeCondition} a first
@@ -394,7 +384,7 @@ exports.subtractRuntime = subtractRuntime;
394
384
  * @param {RuntimeSpec} runtime runtime
395
385
  * @returns {RuntimeCondition} result
396
386
  */
397
- exports.subtractRuntimeCondition = (a, b, runtime) => {
387
+ module.exports.subtractRuntimeCondition = (a, b, runtime) => {
398
388
  if (b === true) return false;
399
389
  if (b === false) return a;
400
390
  if (a === false) return false;
@@ -404,15 +394,15 @@ exports.subtractRuntimeCondition = (a, b, runtime) => {
404
394
 
405
395
  /**
406
396
  * @param {RuntimeSpec} runtime runtime
407
- * @param {function(RuntimeSpec): boolean} filter filter function
397
+ * @param {function(RuntimeSpec=): boolean} filter filter function
408
398
  * @returns {boolean | RuntimeSpec} true/false if filter is constant for all runtimes, otherwise runtimes that are active
409
399
  */
410
- exports.filterRuntime = (runtime, filter) => {
411
- if (runtime === undefined) return filter(undefined);
400
+ module.exports.filterRuntime = (runtime, filter) => {
401
+ if (runtime === undefined) return filter();
412
402
  if (typeof runtime === "string") return filter(runtime);
413
403
  let some = false;
414
404
  let every = true;
415
- let result = undefined;
405
+ let result;
416
406
  for (const r of runtime) {
417
407
  const v = filter(r);
418
408
  if (v) {
@@ -456,7 +446,7 @@ class RuntimeSpecMap {
456
446
  get(runtime) {
457
447
  switch (this._mode) {
458
448
  case 0:
459
- return undefined;
449
+ return;
460
450
  case 1:
461
451
  return runtimeEqual(this._singleRuntime, runtime)
462
452
  ? this._singleValue
@@ -628,6 +618,9 @@ class RuntimeSpecMap {
628
618
  }
629
619
  }
630
620
 
621
+ /**
622
+ * @returns {IterableIterator<T>} values
623
+ */
631
624
  values() {
632
625
  switch (this._mode) {
633
626
  case 0:
@@ -645,7 +638,7 @@ class RuntimeSpecMap {
645
638
  }
646
639
  }
647
640
 
648
- exports.RuntimeSpecMap = RuntimeSpecMap;
641
+ module.exports.RuntimeSpecMap = RuntimeSpecMap;
649
642
 
650
643
  class RuntimeSpecSet {
651
644
  /**
@@ -676,6 +669,9 @@ class RuntimeSpecSet {
676
669
  return this._map.has(getRuntimeKey(runtime));
677
670
  }
678
671
 
672
+ /**
673
+ * @returns {IterableIterator<RuntimeSpec>} iterable iterator
674
+ */
679
675
  [Symbol.iterator]() {
680
676
  return this._map.values();
681
677
  }
@@ -685,4 +681,4 @@ class RuntimeSpecSet {
685
681
  }
686
682
  }
687
683
 
688
- exports.RuntimeSpecSet = RuntimeSpecSet;
684
+ module.exports.RuntimeSpecSet = RuntimeSpecSet;
@@ -32,7 +32,7 @@ const parseVersion = str => {
32
32
  }
33
33
  return ver;
34
34
  };
35
- exports.parseVersion = parseVersion;
35
+ module.exports.parseVersion = parseVersion;
36
36
 
37
37
  /* eslint-disable eqeqeq */
38
38
  /**
@@ -82,13 +82,13 @@ const versionLt = (a, b) => {
82
82
  }
83
83
  };
84
84
  /* eslint-enable eqeqeq */
85
- exports.versionLt = versionLt;
85
+ module.exports.versionLt = versionLt;
86
86
 
87
87
  /**
88
88
  * @param {string} str range string
89
89
  * @returns {SemVerRange} parsed range
90
90
  */
91
- exports.parseRange = str => {
91
+ module.exports.parseRange = str => {
92
92
  const splitAndConvert = str => {
93
93
  return str
94
94
  .split(".")
@@ -126,9 +126,9 @@ exports.parseRange = str => {
126
126
  } else if (range.length === 3) {
127
127
  // Special case for "1.2" is "1.2.x" instead of "=1.2"
128
128
  return [2, ...range.slice(1)];
129
- } else {
130
- return [range.length, ...range.slice(1)];
131
129
  }
130
+
131
+ return [range.length, ...range.slice(1)];
132
132
  };
133
133
  const negate = range => {
134
134
  return [-range[0] - 1, ...range.slice(1)];
@@ -256,30 +256,31 @@ const rangeToString = range => {
256
256
  (needDot > 0 ? "." : "") + ((needDot = 2), item);
257
257
  }
258
258
  return str;
259
- } else {
260
- var stack = [];
259
+ }
260
+ /** @type {string[]} */
261
+ var stack = [];
262
+ // eslint-disable-next-line no-redeclare
263
+ for (var i = 1; i < range.length; i++) {
261
264
  // eslint-disable-next-line no-redeclare
262
- for (var i = 1; i < range.length; i++) {
263
- // eslint-disable-next-line no-redeclare
264
- var item = range[i];
265
- stack.push(
266
- item === 0
267
- ? "not(" + pop() + ")"
268
- : item === 1
269
- ? "(" + pop() + " || " + pop() + ")"
270
- : item === 2
271
- ? stack.pop() + " " + stack.pop()
272
- : rangeToString(item)
273
- );
274
- }
275
- return pop();
265
+ var item = range[i];
266
+ stack.push(
267
+ item === 0
268
+ ? "not(" + pop() + ")"
269
+ : item === 1
270
+ ? "(" + pop() + " || " + pop() + ")"
271
+ : item === 2
272
+ ? stack.pop() + " " + stack.pop()
273
+ : rangeToString(item)
274
+ );
276
275
  }
276
+ return pop();
277
+
277
278
  function pop() {
278
- return stack.pop().replace(/^\((.+)\)$/, "$1");
279
+ return /** @type {string} */ (stack.pop()).replace(/^\((.+)\)$/, "$1");
279
280
  }
280
281
  };
281
282
  /* eslint-enable eqeqeq */
282
- exports.rangeToString = rangeToString;
283
+ module.exports.rangeToString = rangeToString;
283
284
 
284
285
  /* eslint-disable eqeqeq */
285
286
  /**
@@ -399,6 +400,7 @@ const satisfy = (range, version) => {
399
400
  }
400
401
  } else {
401
402
  // Handles all "next-ver" cases in the second table
403
+ // eslint-disable-next-line no-lonely-if
402
404
  if (rangeType != "s" && rangeType != "n") {
403
405
  isEqual = false;
404
406
  j--;
@@ -427,9 +429,9 @@ const satisfy = (range, version) => {
427
429
  return !!p();
428
430
  };
429
431
  /* eslint-enable eqeqeq */
430
- exports.satisfy = satisfy;
432
+ module.exports.satisfy = satisfy;
431
433
 
432
- exports.stringifyHoley = json => {
434
+ module.exports.stringifyHoley = json => {
433
435
  switch (typeof json) {
434
436
  case "undefined":
435
437
  return "";
@@ -442,9 +444,9 @@ exports.stringifyHoley = json => {
442
444
  }
443
445
  str += "]";
444
446
  return str;
445
- } else {
446
- return JSON.stringify(json);
447
447
  }
448
+
449
+ return JSON.stringify(json);
448
450
  default:
449
451
  return JSON.stringify(json);
450
452
  }
@@ -39,7 +39,11 @@ const registerSerializers = memoize(() => {
39
39
  // This allows bundling all internal serializers
40
40
  const internalSerializables = require("./internalSerializables");
41
41
  getObjectMiddleware().registerLoader(/^webpack\/lib\//, req => {
42
- const loader = internalSerializables[req.slice("webpack/lib/".length)];
42
+ const loader =
43
+ internalSerializables[
44
+ /** @type {keyof import("./internalSerializables")} */
45
+ (req.slice("webpack/lib/".length))
46
+ ];
43
47
  if (loader) {
44
48
  loader();
45
49
  } else {
@@ -88,6 +92,9 @@ module.exports = {
88
92
  new SingleItemMiddleware(),
89
93
  new (getObjectMiddleware())(context => {
90
94
  if (context.write) {
95
+ /**
96
+ * @param {any} value value
97
+ */
91
98
  context.writeLazy = value => {
92
99
  context.write(
93
100
  SerializerMiddleware.createLazy(value, binaryMiddleware)
@@ -115,11 +122,19 @@ module.exports = {
115
122
  new SingleItemMiddleware(),
116
123
  new (getObjectMiddleware())(context => {
117
124
  if (context.write) {
125
+ /**
126
+ * @param {any} value value
127
+ */
118
128
  context.writeLazy = value => {
119
129
  context.write(
120
130
  SerializerMiddleware.createLazy(value, binaryMiddleware)
121
131
  );
122
132
  };
133
+ /**
134
+ * @param {any} value value
135
+ * @param {object=} options lazy options
136
+ * @returns {function(): Promise<any> | any} lazy function
137
+ */
123
138
  context.writeSeparate = (value, options) => {
124
139
  const lazy = SerializerMiddleware.createLazy(
125
140
  value,
@@ -16,7 +16,7 @@
16
16
  * @template T
17
17
  * @template R
18
18
  * @typedef {object} GroupConfig
19
- * @property {function(T): string[]} getKeys
19
+ * @property {function(T): string[] | undefined} getKeys
20
20
  * @property {function(string, (R | T)[], T[]): R} createGroup
21
21
  * @property {function(string, T[]): GroupOptions=} getOptions
22
22
  */
@@ -111,10 +111,10 @@ const smartGrouping = (items, groupConfigs) => {
111
111
  const results = [];
112
112
  for (;;) {
113
113
  /** @type {Group<T, R> | undefined} */
114
- let bestGroup = undefined;
114
+ let bestGroup;
115
115
  let bestGroupSize = -1;
116
- let bestGroupItems = undefined;
117
- let bestGroupOptions = undefined;
116
+ let bestGroupItems;
117
+ let bestGroupOptions;
118
118
  for (const [group, state] of groupMap) {
119
119
  const { items, used } = state;
120
120
  let options = state.options;
@@ -138,7 +138,7 @@ const smartGrouping = (items, groupConfigs) => {
138
138
  }
139
139
  }
140
140
  const targetGroupCount = (options && options.targetGroupCount) || 4;
141
- let sizeValue = force
141
+ const sizeValue = force
142
142
  ? items.size
143
143
  : Math.min(
144
144
  items.size,
@@ -58,4 +58,4 @@ const isSourceEqual = (a, b) => {
58
58
  }
59
59
  return result;
60
60
  };
61
- exports.isSourceEqual = isSourceEqual;
61
+ module.exports.isSourceEqual = isSourceEqual;
@@ -52,10 +52,11 @@ class EnableWasmLoadingPlugin {
52
52
  throw new Error(
53
53
  `Library type "${type}" is not enabled. ` +
54
54
  "EnableWasmLoadingPlugin need to be used to enable this type of wasm loading. " +
55
- 'This usually happens through the "output.enabledWasmLoadingTypes" option. ' +
56
- 'If you are using a function as entry which sets "wasmLoading", you need to add all potential library types to "output.enabledWasmLoadingTypes". ' +
57
- "These types are enabled: " +
58
- Array.from(getEnabledTypes(compiler)).join(", ")
55
+ `This usually happens through the "output.enabledWasmLoadingTypes" option. ` +
56
+ `If you are using a function as entry which sets "wasmLoading", you need to add all potential library types to "output.enabledWasmLoadingTypes". ` +
57
+ `These types are enabled: ${Array.from(
58
+ getEnabledTypes(compiler)
59
+ ).join(", ")}`
59
60
  );
60
61
  }
61
62
  }
@@ -81,10 +81,10 @@ class AsyncWasmLoadingRuntimeModule extends RuntimeModule {
81
81
  Template.indent([
82
82
  ".then(",
83
83
  Template.indent([
84
- runtimeTemplate.returningFunction(
84
+ `${runtimeTemplate.returningFunction(
85
85
  "Object.assign(exports, res.instance.exports)",
86
86
  "res"
87
- ) + ",",
87
+ )},`,
88
88
  runtimeTemplate.basicFunction("e", [
89
89
  `if(res.headers.get("Content-Type") !== "application/wasm") {`,
90
90
  Template.indent([
@@ -110,7 +110,7 @@ class AsyncWasmLoadingRuntimeModule extends RuntimeModule {
110
110
  "exports, wasmModuleId, wasmModuleHash, importsObj",
111
111
  this.supportsStreaming
112
112
  ? getStreaming()
113
- : [`return ${loader}`, Template.indent(fallback) + ";"]
113
+ : [`return ${loader}`, `${Template.indent(fallback)};`]
114
114
  )};`;
115
115
  }
116
116
  }
@@ -161,12 +161,11 @@ class AsyncWebAssemblyJavascriptGenerator extends Generator {
161
161
  ])
162
162
  : undefined;
163
163
 
164
- const instantiateCall =
165
- `${RuntimeGlobals.instantiateWasm}(${module.exportsArgument}, ${
166
- module.moduleArgument
167
- }.id, ${JSON.stringify(
168
- chunkGraph.getRenderedModuleHash(module, runtime)
169
- )}` + (importsObj ? `, ${importsObj})` : `)`);
164
+ const instantiateCall = `${RuntimeGlobals.instantiateWasm}(${module.exportsArgument}, ${
165
+ module.moduleArgument
166
+ }.id, ${JSON.stringify(
167
+ chunkGraph.getRenderedModuleHash(module, runtime)
168
+ )}${importsObj ? `, ${importsObj})` : ")"}`;
170
169
 
171
170
  if (promises.length > 0)
172
171
  runtimeRequirements.add(RuntimeGlobals.asyncModule);