webpack 5.90.3 → 5.92.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.

Potentially problematic release.


This version of webpack might be problematic. Click here for more details.

Files changed (257) hide show
  1. package/README.md +5 -5
  2. package/bin/webpack.js +6 -3
  3. package/lib/APIPlugin.js +14 -6
  4. package/lib/AutomaticPrefetchPlugin.js +1 -1
  5. package/lib/BannerPlugin.js +3 -1
  6. package/lib/Cache.js +8 -2
  7. package/lib/CacheFacade.js +3 -3
  8. package/lib/Chunk.js +7 -4
  9. package/lib/ChunkGraph.js +52 -25
  10. package/lib/ChunkGroup.js +23 -17
  11. package/lib/CleanPlugin.js +8 -6
  12. package/lib/Compilation.js +295 -120
  13. package/lib/Compiler.js +223 -87
  14. package/lib/ConcatenationScope.js +3 -3
  15. package/lib/ConditionalInitFragment.js +4 -5
  16. package/lib/ContextModule.js +95 -41
  17. package/lib/ContextModuleFactory.js +4 -2
  18. package/lib/ContextReplacementPlugin.js +3 -2
  19. package/lib/DefinePlugin.js +18 -6
  20. package/lib/Dependency.js +12 -10
  21. package/lib/DependencyTemplate.js +17 -7
  22. package/lib/DllModule.js +1 -0
  23. package/lib/DllReferencePlugin.js +7 -3
  24. package/lib/EntryOptionPlugin.js +4 -1
  25. package/lib/EntryPlugin.js +6 -1
  26. package/lib/Entrypoint.js +1 -1
  27. package/lib/EvalDevToolModulePlugin.js +11 -0
  28. package/lib/ExportsInfo.js +23 -8
  29. package/lib/ExternalModule.js +160 -35
  30. package/lib/ExternalModuleFactoryPlugin.js +37 -2
  31. package/lib/FileSystemInfo.js +69 -42
  32. package/lib/FlagDependencyExportsPlugin.js +21 -7
  33. package/lib/Generator.js +4 -4
  34. package/lib/HookWebpackError.js +2 -2
  35. package/lib/HotModuleReplacementPlugin.js +108 -45
  36. package/lib/IgnorePlugin.js +4 -1
  37. package/lib/InitFragment.js +5 -3
  38. package/lib/LibManifestPlugin.js +17 -9
  39. package/lib/Module.js +41 -14
  40. package/lib/ModuleFactory.js +3 -3
  41. package/lib/ModuleFilenameHelpers.js +30 -17
  42. package/lib/ModuleGraph.js +60 -31
  43. package/lib/ModuleGraphConnection.js +2 -1
  44. package/lib/MultiCompiler.js +62 -9
  45. package/lib/NodeStuffPlugin.js +14 -3
  46. package/lib/NormalModule.js +13 -13
  47. package/lib/NormalModuleFactory.js +18 -9
  48. package/lib/NormalModuleReplacementPlugin.js +5 -1
  49. package/lib/Parser.js +1 -1
  50. package/lib/PlatformPlugin.js +39 -0
  51. package/lib/ProgressPlugin.js +1 -1
  52. package/lib/ProvidePlugin.js +3 -1
  53. package/lib/RawModule.js +2 -1
  54. package/lib/RecordIdsPlugin.js +4 -4
  55. package/lib/ResolverFactory.js +6 -4
  56. package/lib/RuntimeModule.js +4 -4
  57. package/lib/RuntimePlugin.js +1 -0
  58. package/lib/RuntimeTemplate.js +124 -52
  59. package/lib/SourceMapDevToolPlugin.js +4 -1
  60. package/lib/Stats.js +11 -4
  61. package/lib/Template.js +5 -5
  62. package/lib/TemplatedPathPlugin.js +48 -7
  63. package/lib/Watching.js +67 -60
  64. package/lib/WebpackError.js +6 -6
  65. package/lib/WebpackOptionsApply.js +18 -5
  66. package/lib/asset/AssetGenerator.js +15 -0
  67. package/lib/asset/RawDataUrlModule.js +3 -1
  68. package/lib/async-modules/AwaitDependenciesInitFragment.js +2 -2
  69. package/lib/buildChunkGraph.js +120 -67
  70. package/lib/cache/IdleFileCachePlugin.js +8 -3
  71. package/lib/cache/MemoryCachePlugin.js +1 -1
  72. package/lib/cache/MemoryWithGcCachePlugin.js +6 -2
  73. package/lib/cache/PackFileCacheStrategy.js +51 -18
  74. package/lib/cache/ResolverCachePlugin.js +22 -14
  75. package/lib/cache/getLazyHashedEtag.js +2 -2
  76. package/lib/cli.js +5 -5
  77. package/lib/config/browserslistTargetHandler.js +7 -1
  78. package/lib/config/defaults.js +108 -34
  79. package/lib/config/normalization.js +3 -1
  80. package/lib/config/target.js +18 -11
  81. package/lib/container/ContainerEntryDependency.js +2 -1
  82. package/lib/container/ContainerEntryModule.js +4 -2
  83. package/lib/container/ContainerPlugin.js +14 -10
  84. package/lib/container/FallbackModule.js +1 -1
  85. package/lib/container/RemoteRuntimeModule.js +12 -3
  86. package/lib/css/CssExportsGenerator.js +68 -25
  87. package/lib/css/CssGenerator.js +34 -6
  88. package/lib/css/CssLoadingRuntimeModule.js +217 -98
  89. package/lib/css/CssModulesPlugin.js +238 -107
  90. package/lib/css/CssParser.js +24 -15
  91. package/lib/css/walkCssTokens.js +1 -1
  92. package/lib/debug/ProfilingPlugin.js +28 -3
  93. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +9 -5
  94. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +4 -1
  95. package/lib/dependencies/CommonJsDependencyHelpers.js +2 -1
  96. package/lib/dependencies/CommonJsExportRequireDependency.js +33 -18
  97. package/lib/dependencies/CommonJsExportsDependency.js +13 -5
  98. package/lib/dependencies/CommonJsExportsParserPlugin.js +20 -15
  99. package/lib/dependencies/CommonJsImportsParserPlugin.js +1 -2
  100. package/lib/dependencies/ContextDependencyHelpers.js +49 -29
  101. package/lib/dependencies/ContextElementDependency.js +8 -1
  102. package/lib/dependencies/CssExportDependency.js +2 -2
  103. package/lib/dependencies/CssLocalIdentifierDependency.js +71 -9
  104. package/lib/dependencies/CssUrlDependency.js +10 -7
  105. package/lib/dependencies/ExportsInfoDependency.js +5 -4
  106. package/lib/dependencies/ExternalModuleDependency.js +4 -2
  107. package/lib/dependencies/ExternalModuleInitFragment.js +5 -3
  108. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +4 -4
  109. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +43 -23
  110. package/lib/dependencies/HarmonyExportHeaderDependency.js +1 -1
  111. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +73 -32
  112. package/lib/dependencies/HarmonyExportInitFragment.js +10 -2
  113. package/lib/dependencies/HarmonyImportDependency.js +28 -12
  114. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +70 -19
  115. package/lib/dependencies/HarmonyImportSideEffectDependency.js +7 -6
  116. package/lib/dependencies/HarmonyImportSpecifierDependency.js +47 -35
  117. package/lib/dependencies/ImportDependency.js +9 -2
  118. package/lib/dependencies/ImportEagerDependency.js +4 -2
  119. package/lib/dependencies/ImportMetaContextDependency.js +7 -0
  120. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +25 -14
  121. package/lib/dependencies/ImportMetaPlugin.js +1 -1
  122. package/lib/dependencies/ImportParserPlugin.js +15 -5
  123. package/lib/dependencies/ImportWeakDependency.js +4 -2
  124. package/lib/dependencies/LoaderDependency.js +2 -1
  125. package/lib/dependencies/LoaderImportDependency.js +2 -1
  126. package/lib/dependencies/LoaderPlugin.js +2 -2
  127. package/lib/dependencies/ModuleDependency.js +4 -5
  128. package/lib/dependencies/PureExpressionDependency.js +64 -47
  129. package/lib/dependencies/RequireContextPlugin.js +1 -1
  130. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +26 -14
  131. package/lib/dependencies/RequireEnsureDependency.js +1 -1
  132. package/lib/dependencies/URLDependency.js +7 -4
  133. package/lib/dependencies/WorkerDependency.js +1 -1
  134. package/lib/dependencies/WorkerPlugin.js +2 -1
  135. package/lib/dependencies/getFunctionExpression.js +3 -1
  136. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +92 -3
  137. package/lib/hmr/LazyCompilationPlugin.js +2 -2
  138. package/lib/ids/ChunkModuleIdRangePlugin.js +1 -1
  139. package/lib/ids/DeterministicChunkIdsPlugin.js +1 -1
  140. package/lib/ids/DeterministicModuleIdsPlugin.js +1 -1
  141. package/lib/ids/IdHelpers.js +6 -6
  142. package/lib/ids/NamedChunkIdsPlugin.js +1 -1
  143. package/lib/ids/NamedModuleIdsPlugin.js +1 -1
  144. package/lib/ids/SyncModuleIdsPlugin.js +2 -2
  145. package/lib/index.js +11 -0
  146. package/lib/javascript/BasicEvaluatedExpression.js +2 -2
  147. package/lib/javascript/ChunkHelpers.js +2 -2
  148. package/lib/javascript/CommonJsChunkFormatPlugin.js +1 -1
  149. package/lib/javascript/JavascriptGenerator.js +0 -1
  150. package/lib/javascript/JavascriptModulesPlugin.js +174 -17
  151. package/lib/javascript/JavascriptParser.js +204 -71
  152. package/lib/javascript/JavascriptParserHelpers.js +1 -1
  153. package/lib/javascript/StartupHelpers.js +22 -5
  154. package/lib/library/AbstractLibraryPlugin.js +2 -2
  155. package/lib/library/AmdLibraryPlugin.js +2 -2
  156. package/lib/library/AssignLibraryPlugin.js +3 -3
  157. package/lib/library/ExportPropertyLibraryPlugin.js +2 -2
  158. package/lib/library/JsonpLibraryPlugin.js +2 -2
  159. package/lib/library/ModuleLibraryPlugin.js +2 -2
  160. package/lib/library/SystemLibraryPlugin.js +2 -2
  161. package/lib/library/UmdLibraryPlugin.js +33 -12
  162. package/lib/logging/Logger.js +27 -2
  163. package/lib/logging/createConsoleLogger.js +13 -9
  164. package/lib/node/CommonJsChunkLoadingPlugin.js +2 -1
  165. package/lib/node/NodeEnvironmentPlugin.js +14 -8
  166. package/lib/node/NodeTemplatePlugin.js +1 -1
  167. package/lib/node/NodeWatchFileSystem.js +37 -26
  168. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +2 -1
  169. package/lib/node/ReadFileCompileWasmPlugin.js +1 -1
  170. package/lib/node/RequireChunkLoadingRuntimeModule.js +2 -1
  171. package/lib/node/nodeConsole.js +24 -1
  172. package/lib/optimize/AggressiveMergingPlugin.js +1 -1
  173. package/lib/optimize/AggressiveSplittingPlugin.js +1 -0
  174. package/lib/optimize/ConcatenatedModule.js +140 -121
  175. package/lib/optimize/EnsureChunkConditionsPlugin.js +1 -1
  176. package/lib/optimize/InnerGraph.js +8 -3
  177. package/lib/optimize/InnerGraphPlugin.js +36 -13
  178. package/lib/optimize/LimitChunkCountPlugin.js +1 -2
  179. package/lib/optimize/ModuleConcatenationPlugin.js +13 -3
  180. package/lib/optimize/RealContentHashPlugin.js +3 -3
  181. package/lib/optimize/RemoveParentModulesPlugin.js +1 -0
  182. package/lib/optimize/RuntimeChunkPlugin.js +6 -1
  183. package/lib/optimize/SideEffectsFlagPlugin.js +48 -17
  184. package/lib/optimize/SplitChunksPlugin.js +10 -10
  185. package/lib/performance/SizeLimitsPlugin.js +13 -2
  186. package/lib/rules/ObjectMatcherRulePlugin.js +15 -1
  187. package/lib/rules/RuleSetCompiler.js +9 -7
  188. package/lib/runtime/EnsureChunkRuntimeModule.js +2 -1
  189. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +2 -1
  190. package/lib/runtime/LoadScriptRuntimeModule.js +1 -1
  191. package/lib/runtime/StartupChunkDependenciesPlugin.js +1 -1
  192. package/lib/schemes/HttpUriPlugin.js +1 -1
  193. package/lib/serialization/BinaryMiddleware.js +4 -4
  194. package/lib/serialization/FileMiddleware.js +4 -3
  195. package/lib/serialization/NullPrototypeObjectSerializer.js +2 -2
  196. package/lib/serialization/ObjectMiddleware.js +8 -5
  197. package/lib/serialization/PlainObjectSerializer.js +2 -2
  198. package/lib/serialization/Serializer.js +19 -0
  199. package/lib/serialization/SerializerMiddleware.js +2 -2
  200. package/lib/serialization/SingleItemMiddleware.js +2 -2
  201. package/lib/serialization/types.js +1 -1
  202. package/lib/sharing/ConsumeSharedModule.js +2 -2
  203. package/lib/sharing/ConsumeSharedPlugin.js +17 -3
  204. package/lib/sharing/ConsumeSharedRuntimeModule.js +9 -2
  205. package/lib/sharing/ProvideSharedPlugin.js +13 -6
  206. package/lib/sharing/resolveMatchedConfigs.js +3 -3
  207. package/lib/sharing/utils.js +13 -6
  208. package/lib/stats/DefaultStatsFactoryPlugin.js +20 -20
  209. package/lib/stats/DefaultStatsPrinterPlugin.js +1 -1
  210. package/lib/stats/StatsFactory.js +2 -2
  211. package/lib/stats/StatsPrinter.js +6 -6
  212. package/lib/util/ArrayQueue.js +14 -21
  213. package/lib/util/AsyncQueue.js +1 -1
  214. package/lib/util/Queue.js +8 -2
  215. package/lib/util/SortableSet.js +16 -4
  216. package/lib/util/StackedCacheMap.js +26 -0
  217. package/lib/util/TupleQueue.js +8 -2
  218. package/lib/util/WeakTupleMap.js +57 -13
  219. package/lib/util/binarySearchBounds.js +1 -1
  220. package/lib/util/cleverMerge.js +26 -13
  221. package/lib/util/comparators.js +37 -15
  222. package/lib/util/conventions.js +129 -0
  223. package/lib/util/createHash.js +3 -5
  224. package/lib/util/deprecation.js +3 -3
  225. package/lib/util/deterministicGrouping.js +2 -2
  226. package/lib/util/findGraphRoots.js +1 -1
  227. package/lib/util/fs.js +383 -69
  228. package/lib/util/hash/BatchedHash.js +3 -0
  229. package/lib/util/hash/xxhash64.js +2 -2
  230. package/lib/util/identifier.js +5 -5
  231. package/lib/util/mergeScope.js +79 -0
  232. package/lib/util/runtime.js +2 -17
  233. package/lib/util/semver.js +3 -0
  234. package/lib/util/smartGrouping.js +3 -3
  235. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +4 -2
  236. package/lib/wasm-async/AsyncWebAssemblyGenerator.js +1 -1
  237. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +4 -2
  238. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +3 -3
  239. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +16 -7
  240. package/lib/wasm-sync/WebAssemblyGenerator.js +40 -19
  241. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +1 -1
  242. package/lib/wasm-sync/WebAssemblyParser.js +7 -4
  243. package/lib/wasm-sync/WebAssemblyUtils.js +2 -1
  244. package/lib/web/FetchCompileWasmPlugin.js +1 -1
  245. package/lib/web/JsonpChunkLoadingRuntimeModule.js +3 -2
  246. package/lib/webpack.js +19 -6
  247. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +2 -1
  248. package/package.json +40 -39
  249. package/schemas/WebpackOptions.check.js +1 -1
  250. package/schemas/WebpackOptions.json +97 -8
  251. package/schemas/plugins/BannerPlugin.check.js +1 -1
  252. package/schemas/plugins/BannerPlugin.json +5 -1
  253. package/schemas/plugins/css/CssAutoGeneratorOptions.check.js +1 -1
  254. package/schemas/plugins/css/CssGeneratorOptions.check.js +1 -1
  255. package/schemas/plugins/css/CssGlobalGeneratorOptions.check.js +1 -1
  256. package/schemas/plugins/css/CssModuleGeneratorOptions.check.js +1 -1
  257. package/types.d.ts +1826 -639
@@ -24,19 +24,23 @@ const processExportInfo = require("./processExportInfo");
24
24
  /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
25
25
  /** @typedef {import("../ChunkGraph")} ChunkGraph */
26
26
  /** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */
27
+ /** @typedef {import("../Dependency").GetConditionFn} GetConditionFn */
27
28
  /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */
28
29
  /** @typedef {import("../Dependency").TRANSITIVE} TRANSITIVE */
29
30
  /** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */
30
31
  /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
31
32
  /** @typedef {import("../ExportsInfo")} ExportsInfo */
32
33
  /** @typedef {import("../ExportsInfo").ExportInfo} ExportInfo */
34
+ /** @typedef {import("../Generator").GenerateContext} GenerateContext */
33
35
  /** @typedef {import("../Module")} Module */
36
+ /** @typedef {import("../Module").BuildMeta} BuildMeta */
37
+ /** @typedef {import("../Module").RuntimeRequirements} RuntimeRequirements */
34
38
  /** @typedef {import("../ModuleGraph")} ModuleGraph */
35
39
  /** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */
36
40
  /** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */
37
41
  /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
38
42
  /** @typedef {import("../WebpackError")} WebpackError */
39
- /** @typedef {import("../javascript/JavascriptParser").Assertions} Assertions */
43
+ /** @typedef {import("../javascript/JavascriptParser").ImportAttributes} ImportAttributes */
40
44
  /** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
41
45
  /** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
42
46
  /** @typedef {import("../util/Hash")} Hash */
@@ -78,7 +82,7 @@ class ExportMode {
78
82
  this.items = null;
79
83
 
80
84
  // for "reexport-named-default" | "reexport-fake-namespace-object" | "reexport-namespace-object"
81
- /** @type {string|null} */
85
+ /** @type {string | null} */
82
86
  this.name = null;
83
87
  /** @type {ExportInfo | null} */
84
88
  this.partialNamespaceExportInfo = null;
@@ -176,7 +180,7 @@ const getMode = (moduleGraph, dep, runtimeKey) => {
176
180
 
177
181
  const name = dep.name;
178
182
  const runtime = keyToRuntime(runtimeKey);
179
- const parentModule = moduleGraph.getParentModule(dep);
183
+ const parentModule = /** @type {Module} */ (moduleGraph.getParentModule(dep));
180
184
  const exportsInfo = moduleGraph.getExportsInfo(parentModule);
181
185
 
182
186
  if (
@@ -193,7 +197,7 @@ const getMode = (moduleGraph, dep, runtimeKey) => {
193
197
 
194
198
  const importedExportsType = importedModule.getExportsType(
195
199
  moduleGraph,
196
- parentModule.buildMeta.strictHarmonyModule
200
+ /** @type {BuildMeta} */ (parentModule.buildMeta).strictHarmonyModule
197
201
  );
198
202
 
199
203
  const ids = dep.getIds(moduleGraph);
@@ -333,7 +337,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
333
337
  * @param {ReadonlyArray<HarmonyExportImportedSpecifierDependency> | Iterable<HarmonyExportImportedSpecifierDependency> | null} otherStarExports other star exports in the module before this import
334
338
  * @param {number} exportPresenceMode mode of checking export names
335
339
  * @param {HarmonyStarExportsList | null} allStarExports all star exports in the module
336
- * @param {Assertions=} assertions import assertions
340
+ * @param {ImportAttributes=} attributes import attributes
337
341
  */
338
342
  constructor(
339
343
  request,
@@ -344,9 +348,9 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
344
348
  otherStarExports,
345
349
  exportPresenceMode,
346
350
  allStarExports,
347
- assertions
351
+ attributes
348
352
  ) {
349
- super(request, sourceOrder, assertions);
353
+ super(request, sourceOrder, attributes);
350
354
 
351
355
  this.ids = ids;
352
356
  this.name = name;
@@ -422,11 +426,12 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
422
426
  getStarReexports(
423
427
  moduleGraph,
424
428
  runtime,
425
- exportsInfo = moduleGraph.getExportsInfo(moduleGraph.getParentModule(this)),
426
- importedModule = moduleGraph.getModule(this)
429
+ exportsInfo = moduleGraph.getExportsInfo(
430
+ /** @type {Module} */ (moduleGraph.getParentModule(this))
431
+ ),
432
+ importedModule = /** @type {Module} */ (moduleGraph.getModule(this))
427
433
  ) {
428
434
  const importedExportsInfo = moduleGraph.getExportsInfo(importedModule);
429
-
430
435
  const noExtraExports =
431
436
  importedExportsInfo.otherExportsInfo.provided === false;
432
437
  const noExtraImports =
@@ -456,7 +461,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
456
461
  const exports = new Set();
457
462
  /** @type {Set<string>} */
458
463
  const checked = new Set();
459
- /** @type {Set<string>} */
464
+ /** @type {Set<string> | undefined} */
460
465
  const hidden = hiddenExports !== undefined ? new Set() : undefined;
461
466
 
462
467
  if (noExtraImports) {
@@ -468,7 +473,8 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
468
473
  importedExportsInfo.getReadOnlyExportInfo(name);
469
474
  if (importedExportInfo.provided === false) continue;
470
475
  if (hiddenExports !== undefined && hiddenExports.has(name)) {
471
- hidden.add(name);
476
+ /** @type {Set<string>} */
477
+ (hidden).add(name);
472
478
  continue;
473
479
  }
474
480
  exports.add(name);
@@ -483,7 +489,8 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
483
489
  const exportInfo = exportsInfo.getReadOnlyExportInfo(name);
484
490
  if (exportInfo.getUsed(runtime) === UsageState.Unused) continue;
485
491
  if (hiddenExports !== undefined && hiddenExports.has(name)) {
486
- hidden.add(name);
492
+ /** @type {Set<string>} */
493
+ (hidden).add(name);
487
494
  continue;
488
495
  }
489
496
  exports.add(name);
@@ -497,7 +504,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
497
504
 
498
505
  /**
499
506
  * @param {ModuleGraph} moduleGraph module graph
500
- * @returns {null | false | function(ModuleGraphConnection, RuntimeSpec): ConnectionState} function to determine if the connection is active
507
+ * @returns {null | false | GetConditionFn} function to determine if the connection is active
501
508
  */
502
509
  getCondition(moduleGraph) {
503
510
  return (connection, runtime) => {
@@ -633,7 +640,9 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
633
640
  case "missing":
634
641
  return undefined;
635
642
  case "dynamic-reexport": {
636
- const from = moduleGraph.getConnection(this);
643
+ const from =
644
+ /** @type {ModuleGraphConnection} */
645
+ (moduleGraph.getConnection(this));
637
646
  return {
638
647
  exports: true,
639
648
  from,
@@ -649,11 +658,13 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
649
658
  return {
650
659
  exports: [],
651
660
  hideExports: mode.hidden,
652
- dependencies: [moduleGraph.getModule(this)]
661
+ dependencies: [/** @type {Module} */ (moduleGraph.getModule(this))]
653
662
  };
654
663
  // falls through
655
664
  case "normal-reexport": {
656
- const from = moduleGraph.getConnection(this);
665
+ const from =
666
+ /** @type {ModuleGraphConnection} */
667
+ (moduleGraph.getConnection(this));
657
668
  return {
658
669
  exports: Array.from(mode.items, item => ({
659
670
  name: item.name,
@@ -667,11 +678,13 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
667
678
  }
668
679
  case "reexport-dynamic-default": {
669
680
  {
670
- const from = moduleGraph.getConnection(this);
681
+ const from =
682
+ /** @type {ModuleGraphConnection} */
683
+ (moduleGraph.getConnection(this));
671
684
  return {
672
685
  exports: [
673
686
  {
674
- name: mode.name,
687
+ name: /** @type {string} */ (mode.name),
675
688
  from,
676
689
  export: ["default"]
677
690
  }
@@ -683,15 +696,17 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
683
696
  }
684
697
  case "reexport-undefined":
685
698
  return {
686
- exports: [mode.name],
687
- dependencies: [moduleGraph.getModule(this)]
699
+ exports: [/** @type {string} */ (mode.name)],
700
+ dependencies: [/** @type {Module} */ (moduleGraph.getModule(this))]
688
701
  };
689
702
  case "reexport-fake-namespace-object": {
690
- const from = moduleGraph.getConnection(this);
703
+ const from =
704
+ /** @type {ModuleGraphConnection} */
705
+ (moduleGraph.getConnection(this));
691
706
  return {
692
707
  exports: [
693
708
  {
694
- name: mode.name,
709
+ name: /** @type {string} */ (mode.name),
695
710
  from,
696
711
  export: null,
697
712
  exports: [
@@ -709,11 +724,13 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
709
724
  };
710
725
  }
711
726
  case "reexport-namespace-object": {
712
- const from = moduleGraph.getConnection(this);
727
+ const from =
728
+ /** @type {ModuleGraphConnection} */
729
+ (moduleGraph.getConnection(this));
713
730
  return {
714
731
  exports: [
715
732
  {
716
- name: mode.name,
733
+ name: /** @type {string} */ (mode.name),
717
734
  from,
718
735
  export: null
719
736
  }
@@ -723,11 +740,13 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
723
740
  };
724
741
  }
725
742
  case "reexport-named-default": {
726
- const from = moduleGraph.getConnection(this);
743
+ const from =
744
+ /** @type {ModuleGraphConnection} */
745
+ (moduleGraph.getConnection(this));
727
746
  return {
728
747
  exports: [
729
748
  {
730
- name: mode.name,
749
+ name: /** @type {string} */ (mode.name),
731
750
  from,
732
751
  export: ["default"]
733
752
  }
@@ -748,7 +767,8 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
748
767
  _getEffectiveExportPresenceLevel(moduleGraph) {
749
768
  if (this.exportPresenceMode !== ExportPresenceModes.AUTO)
750
769
  return this.exportPresenceMode;
751
- return moduleGraph.getParentModule(this).buildMeta.strictHarmonyModule
770
+ const module = /** @type {Module} */ (moduleGraph.getParentModule(this));
771
+ return /** @type {BuildMeta} */ (module.buildMeta).strictHarmonyModule
752
772
  ? ExportPresenceModes.ERROR
753
773
  : ExportPresenceModes.WARN;
754
774
  }
@@ -826,7 +846,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
826
846
  );
827
847
  if (conflictingModule === importedModule) continue;
828
848
  const conflictingExportInfo = moduleGraph.getExportInfo(
829
- conflictingModule,
849
+ /** @type {Module} */ (conflictingModule),
830
850
  exportInfo.name
831
851
  );
832
852
  const conflictingTarget =
@@ -948,14 +968,14 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
948
968
  }
949
969
 
950
970
  /**
951
- * @param {InitFragment[]} initFragments target array for init fragments
971
+ * @param {InitFragment<GenerateContext>[]} initFragments target array for init fragments
952
972
  * @param {HarmonyExportImportedSpecifierDependency} dep dependency
953
973
  * @param {ExportMode} mode the export mode
954
974
  * @param {Module} module the current module
955
975
  * @param {ModuleGraph} moduleGraph the module graph
956
976
  * @param {RuntimeSpec} runtime the runtime
957
977
  * @param {RuntimeTemplate} runtimeTemplate the runtime template
958
- * @param {Set<string>} runtimeRequirements runtime requirements
978
+ * @param {RuntimeRequirements} runtimeRequirements runtime requirements
959
979
  * @returns {void}
960
980
  */
961
981
  _addExportFragments(
@@ -968,7 +988,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
968
988
  runtimeTemplate,
969
989
  runtimeRequirements
970
990
  ) {
971
- const importedModule = moduleGraph.getModule(dep);
991
+ const importedModule = /** @type {Module} */ (moduleGraph.getModule(dep));
972
992
  const importVar = dep.getImportVar(moduleGraph);
973
993
 
974
994
  switch (mode.type) {
@@ -1169,6 +1189,14 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
1169
1189
  return new HarmonyExportInitFragment(module.exportsArgument, map);
1170
1190
  }
1171
1191
 
1192
+ /**
1193
+ * @param {Module} module module
1194
+ * @param {string | string[] | false} key key
1195
+ * @param {string} name name
1196
+ * @param {number} fakeType fake type
1197
+ * @param {RuntimeRequirements} runtimeRequirements runtime requirements
1198
+ * @returns {[InitFragment<GenerateContext>, HarmonyExportInitFragment]} init fragments
1199
+ */
1172
1200
  getReexportFakeNamespaceObjectFragments(
1173
1201
  module,
1174
1202
  key,
@@ -1199,6 +1227,14 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
1199
1227
  ];
1200
1228
  }
1201
1229
 
1230
+ /**
1231
+ * @param {Module} module module
1232
+ * @param {string} key key
1233
+ * @param {string} name name
1234
+ * @param {string | string[] | false} valueKey value key
1235
+ * @param {RuntimeRequirements} runtimeRequirements runtime requirements
1236
+ * @returns {string} result
1237
+ */
1202
1238
  getConditionalReexportStatement(
1203
1239
  module,
1204
1240
  key,
@@ -1226,6 +1262,11 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
1226
1262
  )}: function() { return ${returnValue}; } });\n`;
1227
1263
  }
1228
1264
 
1265
+ /**
1266
+ * @param {string} name name
1267
+ * @param {null | false | string | string[]} valueKey value key
1268
+ * @returns {string | undefined} value
1269
+ */
1229
1270
  getReturnValue(name, valueKey) {
1230
1271
  if (valueKey === null) {
1231
1272
  return `${name}_default.a`;
@@ -13,6 +13,10 @@ const { propertyName } = require("../util/propertyName");
13
13
  /** @typedef {import("webpack-sources").Source} Source */
14
14
  /** @typedef {import("../Generator").GenerateContext} GenerateContext */
15
15
 
16
+ /**
17
+ * @param {Iterable<string>} iterable iterable strings
18
+ * @returns {string} result
19
+ */
16
20
  const joinIterableWithComma = iterable => {
17
21
  // This is more performant than Array.from().join(", ")
18
22
  // as it doesn't create an array
@@ -33,7 +37,7 @@ const EMPTY_MAP = new Map();
33
37
  const EMPTY_SET = new Set();
34
38
 
35
39
  /**
36
- * @typedef {GenerateContext} Context
40
+ * @extends {InitFragment<GenerateContext>} Context
37
41
  */
38
42
  class HarmonyExportInitFragment extends InitFragment {
39
43
  /**
@@ -99,6 +103,10 @@ class HarmonyExportInitFragment extends InitFragment {
99
103
  );
100
104
  }
101
105
 
106
+ /**
107
+ * @param {HarmonyExportInitFragment} other other
108
+ * @returns {HarmonyExportInitFragment} merged result
109
+ */
102
110
  merge(other) {
103
111
  let exportMap;
104
112
  if (this.exportMap.size === 0) {
@@ -131,7 +139,7 @@ class HarmonyExportInitFragment extends InitFragment {
131
139
 
132
140
  /**
133
141
  * @param {GenerateContext} context context
134
- * @returns {string | Source} the source code that will be included as initialization code
142
+ * @returns {string | Source | undefined} the source code that will be included as initialization code
135
143
  */
136
144
  getContent({ runtimeTemplate, runtimeRequirements }) {
137
145
  runtimeRequirements.add(RuntimeGlobals.exports);
@@ -20,11 +20,13 @@ const ModuleDependency = require("./ModuleDependency");
20
20
  /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */
21
21
  /** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */
22
22
  /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
23
+ /** @typedef {import("../ExportsInfo")} ExportsInfo */
23
24
  /** @typedef {import("../Module")} Module */
25
+ /** @typedef {import("../Module").BuildMeta} BuildMeta */
24
26
  /** @typedef {import("../ModuleGraph")} ModuleGraph */
25
27
  /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
26
28
  /** @typedef {import("../WebpackError")} WebpackError */
27
- /** @typedef {import("../javascript/JavascriptParser").Assertions} Assertions */
29
+ /** @typedef {import("../javascript/JavascriptParser").ImportAttributes} ImportAttributes */
28
30
  /** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
29
31
  /** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
30
32
  /** @typedef {import("../util/Hash")} Hash */
@@ -35,6 +37,10 @@ const ExportPresenceModes = {
35
37
  WARN: /** @type {1} */ (1),
36
38
  AUTO: /** @type {2} */ (2),
37
39
  ERROR: /** @type {3} */ (3),
40
+ /**
41
+ * @param {string | false} str param
42
+ * @returns {0 | 1 | 2 | 3} result
43
+ */
38
44
  fromUserOption(str) {
39
45
  switch (str) {
40
46
  case "error":
@@ -56,12 +62,12 @@ class HarmonyImportDependency extends ModuleDependency {
56
62
  *
57
63
  * @param {string} request request string
58
64
  * @param {number} sourceOrder source order
59
- * @param {Assertions=} assertions import assertions
65
+ * @param {ImportAttributes=} attributes import attributes
60
66
  */
61
- constructor(request, sourceOrder, assertions) {
67
+ constructor(request, sourceOrder, attributes) {
62
68
  super(request);
63
69
  this.sourceOrder = sourceOrder;
64
- this.assertions = assertions;
70
+ this.assertions = attributes;
65
71
  }
66
72
 
67
73
  get category() {
@@ -84,15 +90,20 @@ class HarmonyImportDependency extends ModuleDependency {
84
90
  */
85
91
  getImportVar(moduleGraph) {
86
92
  const module = moduleGraph.getParentModule(this);
87
- const meta = moduleGraph.getMeta(module);
93
+ const meta = /** @type {TODO} */ (moduleGraph.getMeta(module));
88
94
  let importVarMap = meta.importVarMap;
89
95
  if (!importVarMap) meta.importVarMap = importVarMap = new Map();
90
- let importVar = importVarMap.get(moduleGraph.getModule(this));
96
+ let importVar = importVarMap.get(
97
+ /** @type {Module} */ (moduleGraph.getModule(this))
98
+ );
91
99
  if (importVar) return importVar;
92
100
  importVar = `${Template.toIdentifier(
93
101
  `${this.userRequest}`
94
102
  )}__WEBPACK_IMPORTED_MODULE_${importVarMap.size}__`;
95
- importVarMap.set(moduleGraph.getModule(this), importVar);
103
+ importVarMap.set(
104
+ /** @type {Module} */ (moduleGraph.getModule(this)),
105
+ importVar
106
+ );
96
107
  return importVar;
97
108
  }
98
109
 
@@ -107,7 +118,7 @@ class HarmonyImportDependency extends ModuleDependency {
107
118
  ) {
108
119
  return runtimeTemplate.importStatement({
109
120
  update,
110
- module: moduleGraph.getModule(this),
121
+ module: /** @type {Module} */ (moduleGraph.getModule(this)),
111
122
  chunkGraph,
112
123
  importVar: this.getImportVar(moduleGraph),
113
124
  request: this.request,
@@ -129,10 +140,12 @@ class HarmonyImportDependency extends ModuleDependency {
129
140
  return;
130
141
  }
131
142
 
132
- const parentModule = moduleGraph.getParentModule(this);
143
+ const parentModule =
144
+ /** @type {Module} */
145
+ (moduleGraph.getParentModule(this));
133
146
  const exportsType = importedModule.getExportsType(
134
147
  moduleGraph,
135
- parentModule.buildMeta.strictHarmonyModule
148
+ /** @type {BuildMeta} */ (parentModule.buildMeta).strictHarmonyModule
136
149
  );
137
150
  if (exportsType === "namespace" || exportsType === "default-with-named") {
138
151
  if (ids.length === 0) {
@@ -170,7 +183,9 @@ class HarmonyImportDependency extends ModuleDependency {
170
183
  )
171
184
  ];
172
185
  }
173
- exportsInfo = exportInfo.getNestedExportsInfo();
186
+ exportsInfo =
187
+ /** @type {ExportsInfo} */
188
+ (exportInfo.getNestedExportsInfo());
174
189
  }
175
190
 
176
191
  // General error message
@@ -207,7 +222,8 @@ class HarmonyImportDependency extends ModuleDependency {
207
222
  if (
208
223
  ids.length > 0 &&
209
224
  ids[0] !== "default" &&
210
- importedModule.buildMeta.defaultObject === "redirect-warn"
225
+ /** @type {BuildMeta} */
226
+ (importedModule.buildMeta).defaultObject === "redirect-warn"
211
227
  ) {
212
228
  // For these modules only the default export is supported
213
229
  return [
@@ -21,11 +21,16 @@ const HarmonyImportSpecifierDependency = require("./HarmonyImportSpecifierDepend
21
21
  /** @typedef {import("estree").Identifier} Identifier */
22
22
  /** @typedef {import("estree").ImportDeclaration} ImportDeclaration */
23
23
  /** @typedef {import("estree").ImportExpression} ImportExpression */
24
+ /** @typedef {import("estree").Literal} Literal */
24
25
  /** @typedef {import("estree").MemberExpression} MemberExpression */
26
+ /** @typedef {import("estree").ObjectExpression} ObjectExpression */
27
+ /** @typedef {import("estree").Property} Property */
25
28
  /** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */
26
29
  /** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
27
30
  /** @typedef {import("../javascript/BasicEvaluatedExpression")} BasicEvaluatedExpression */
28
31
  /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */
32
+ /** @typedef {import("../javascript/JavascriptParser").DestructuringAssignmentProperty} DestructuringAssignmentProperty */
33
+ /** @typedef {import("../javascript/JavascriptParser").ImportAttributes} ImportAttributes */
29
34
  /** @typedef {import("../javascript/JavascriptParser").Range} Range */
30
35
  /** @typedef {import("../optimize/InnerGraph").InnerGraph} InnerGraph */
31
36
  /** @typedef {import("../optimize/InnerGraph").TopLevelSymbol} TopLevelSymbol */
@@ -34,7 +39,7 @@ const HarmonyImportSpecifierDependency = require("./HarmonyImportSpecifierDepend
34
39
  const harmonySpecifierTag = Symbol("harmony import");
35
40
 
36
41
  /**
37
- * @typedef {Object} HarmonySettings
42
+ * @typedef {object} HarmonySettings
38
43
  * @property {string[]} ids
39
44
  * @property {string} source
40
45
  * @property {number} sourceOrder
@@ -44,24 +49,68 @@ const harmonySpecifierTag = Symbol("harmony import");
44
49
  */
45
50
 
46
51
  /**
47
- * @param {ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpression} node node with assertions
48
- * @returns {Record<string, any> | undefined} assertions
52
+ * @param {ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | (ImportExpression & { arguments?: ObjectExpression[] })} node node with assertions
53
+ * @returns {ImportAttributes} import attributes
49
54
  */
50
- function getAssertions(node) {
55
+ function getAttributes(node) {
56
+ if (
57
+ node.type === "ImportExpression" &&
58
+ node.arguments &&
59
+ node.arguments[0] &&
60
+ node.arguments[0].type === "ObjectExpression" &&
61
+ node.arguments[0].properties[0] &&
62
+ node.arguments[0].properties[0].type === "Property" &&
63
+ node.arguments[0].properties[0].value.type === "ObjectExpression" &&
64
+ node.arguments[0].properties[0].value.properties
65
+ ) {
66
+ const properties =
67
+ /** @type {Property[]} */
68
+ (node.arguments[0].properties[0].value.properties);
69
+ const result = /** @type {ImportAttributes} */ ({});
70
+ for (const property of properties) {
71
+ const key =
72
+ /** @type {string} */
73
+ (
74
+ property.key.type === "Identifier"
75
+ ? property.key.name
76
+ : /** @type {Literal} */ (property.key).value
77
+ );
78
+ result[key] =
79
+ /** @type {string} */
80
+ (/** @type {Literal} */ (property.value).value);
81
+ }
82
+ const key =
83
+ node.arguments[0].properties[0].key.type === "Identifier"
84
+ ? node.arguments[0].properties[0].key.name
85
+ : /** @type {Literal} */ (node.arguments[0].properties[0].key).value;
86
+ if (key === "assert") {
87
+ result._isLegacyAssert = true;
88
+ }
89
+ return result;
90
+ }
51
91
  // TODO remove cast when @types/estree has been updated to import assertions
52
- const assertions = /** @type {{ assertions?: ImportAttributeNode[] }} */ (
53
- node
54
- ).assertions;
55
- if (assertions === undefined) {
92
+ const isImportAssertion =
93
+ /** @type {{ assertions?: ImportAttributeNode[] }} */ (node).assertions !==
94
+ undefined;
95
+ const attributes = isImportAssertion
96
+ ? /** @type {{ assertions?: ImportAttributeNode[] }} */ (node).assertions
97
+ : /** @type {{ attributes?: ImportAttributeNode[] }} */ (node).attributes;
98
+ if (attributes === undefined) {
56
99
  return undefined;
57
100
  }
58
- const result = {};
59
- for (const assertion of assertions) {
101
+ const result = /** @type {ImportAttributes} */ ({});
102
+ for (const attribute of attributes) {
60
103
  const key =
61
- assertion.key.type === "Identifier"
62
- ? assertion.key.name
63
- : assertion.key.value;
64
- result[key] = assertion.value.value;
104
+ /** @type {string} */
105
+ (
106
+ attribute.key.type === "Identifier"
107
+ ? attribute.key.name
108
+ : attribute.key.value
109
+ );
110
+ result[key] = /** @type {string} */ (attribute.value.value);
111
+ }
112
+ if (isImportAssertion) {
113
+ result._isLegacyAssert = true;
65
114
  }
66
115
  return result;
67
116
  }
@@ -125,11 +174,11 @@ module.exports = class HarmonyImportDependencyParserPlugin {
125
174
  clearDep.loc = /** @type {DependencyLocation} */ (statement.loc);
126
175
  parser.state.module.addPresentationalDependency(clearDep);
127
176
  parser.unsetAsiPosition(/** @type {Range} */ (statement.range)[1]);
128
- const assertions = getAssertions(statement);
177
+ const attributes = getAttributes(statement);
129
178
  const sideEffectDep = new HarmonyImportSideEffectDependency(
130
- source,
179
+ /** @type {string} */ (source),
131
180
  parser.state.lastHarmonyImportOrder,
132
- assertions
181
+ attributes
133
182
  );
134
183
  sideEffectDep.loc = /** @type {DependencyLocation} */ (statement.loc);
135
184
  parser.state.module.addDependency(sideEffectDep);
@@ -145,7 +194,7 @@ module.exports = class HarmonyImportDependencyParserPlugin {
145
194
  source,
146
195
  ids,
147
196
  sourceOrder: parser.state.lastHarmonyImportOrder,
148
- assertions: getAssertions(statement)
197
+ assertions: getAttributes(statement)
149
198
  });
150
199
  return true;
151
200
  }
@@ -368,4 +417,6 @@ module.exports = class HarmonyImportDependencyParserPlugin {
368
417
  };
369
418
 
370
419
  module.exports.harmonySpecifierTag = harmonySpecifierTag;
371
- module.exports.getAssertions = getAssertions;
420
+ // TODO remove it in webpack@6 in favor getAttributes
421
+ module.exports.getAssertions = getAttributes;
422
+ module.exports.getAttributes = getAttributes;
@@ -10,23 +10,24 @@ const HarmonyImportDependency = require("./HarmonyImportDependency");
10
10
 
11
11
  /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
12
12
  /** @typedef {import("../Dependency")} Dependency */
13
+ /** @typedef {import("../Dependency").GetConditionFn} GetConditionFn */
13
14
  /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
14
15
  /** @typedef {import("../Module")} Module */
15
16
  /** @typedef {import("../ModuleGraph")} ModuleGraph */
16
17
  /** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */
17
18
  /** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */
18
- /** @typedef {import("../javascript/JavascriptParser").Assertions} Assertions */
19
+ /** @typedef {import("../javascript/JavascriptParser").ImportAttributes} ImportAttributes */
19
20
  /** @typedef {import("../util/Hash")} Hash */
20
21
  /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
21
22
 
22
23
  class HarmonyImportSideEffectDependency extends HarmonyImportDependency {
23
24
  /**
24
- * @param {TODO} request the request string
25
+ * @param {string} request the request string
25
26
  * @param {number} sourceOrder source order
26
- * @param {Assertions=} assertions assertions
27
+ * @param {ImportAttributes=} attributes import attributes
27
28
  */
28
- constructor(request, sourceOrder, assertions) {
29
- super(request, sourceOrder, assertions);
29
+ constructor(request, sourceOrder, attributes) {
30
+ super(request, sourceOrder, attributes);
30
31
  }
31
32
 
32
33
  get type() {
@@ -35,7 +36,7 @@ class HarmonyImportSideEffectDependency extends HarmonyImportDependency {
35
36
 
36
37
  /**
37
38
  * @param {ModuleGraph} moduleGraph module graph
38
- * @returns {null | false | function(ModuleGraphConnection, RuntimeSpec): ConnectionState} function to determine if the connection is active
39
+ * @returns {null | false | GetConditionFn} function to determine if the connection is active
39
40
  */
40
41
  getCondition(moduleGraph) {
41
42
  return connection => {