webpack 5.104.1 → 5.105.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/README.md +2 -2
  2. package/bin/webpack.js +6 -3
  3. package/lib/APIPlugin.js +85 -15
  4. package/lib/AbstractMethodError.js +1 -0
  5. package/lib/AsyncDependenciesBlock.js +17 -2
  6. package/lib/AsyncDependencyToInitialChunkError.js +3 -0
  7. package/lib/AutomaticPrefetchPlugin.js +1 -1
  8. package/lib/BannerPlugin.js +5 -1
  9. package/lib/CacheFacade.js +2 -2
  10. package/lib/CaseSensitiveModulesWarning.js +1 -0
  11. package/lib/Chunk.js +9 -5
  12. package/lib/ChunkGraph.js +30 -9
  13. package/lib/ChunkGroup.js +6 -3
  14. package/lib/ChunkRenderError.js +9 -2
  15. package/lib/CleanPlugin.js +4 -1
  16. package/lib/CodeGenerationError.js +7 -1
  17. package/lib/CodeGenerationResults.js +10 -3
  18. package/lib/CommentCompilationWarning.js +2 -1
  19. package/lib/Compilation.js +284 -236
  20. package/lib/Compiler.js +4 -3
  21. package/lib/ConcatenationScope.js +2 -1
  22. package/lib/ConcurrentCompilationError.js +3 -3
  23. package/lib/ContextModule.js +248 -111
  24. package/lib/ContextModuleFactory.js +14 -2
  25. package/lib/DefinePlugin.js +15 -8
  26. package/lib/DelegatedModule.js +6 -0
  27. package/lib/DelegatedModuleFactoryPlugin.js +2 -0
  28. package/lib/Dependency.js +6 -1
  29. package/lib/DependencyTemplates.js +3 -2
  30. package/lib/DllModule.js +2 -0
  31. package/lib/DllReferencePlugin.js +1 -0
  32. package/lib/DotenvPlugin.js +11 -5
  33. package/lib/DynamicEntryPlugin.js +8 -1
  34. package/lib/EnvironmentNotSupportAsyncWarning.js +1 -0
  35. package/lib/EvalSourceMapDevToolPlugin.js +17 -13
  36. package/lib/ExportsInfo.js +8 -4
  37. package/lib/ExternalModule.js +16 -0
  38. package/lib/ExternalModuleFactoryPlugin.js +9 -2
  39. package/lib/ExternalsPlugin.js +2 -1
  40. package/lib/FalseIIFEUmdWarning.js +1 -0
  41. package/lib/FileSystemInfo.js +49 -25
  42. package/lib/FlagDependencyExportsPlugin.js +8 -1
  43. package/lib/FlagDependencyUsagePlugin.js +9 -7
  44. package/lib/HarmonyLinkingError.js +1 -0
  45. package/lib/HookWebpackError.js +2 -0
  46. package/lib/HotModuleReplacementPlugin.js +16 -2
  47. package/lib/IgnoreWarningsPlugin.js +5 -2
  48. package/lib/InitFragment.js +1 -0
  49. package/lib/InvalidDependenciesModuleWarning.js +1 -0
  50. package/lib/LibManifestPlugin.js +1 -0
  51. package/lib/ManifestPlugin.js +8 -1
  52. package/lib/Module.js +7 -4
  53. package/lib/ModuleBuildError.js +3 -1
  54. package/lib/ModuleDependencyError.js +1 -0
  55. package/lib/ModuleDependencyWarning.js +1 -0
  56. package/lib/ModuleError.js +4 -1
  57. package/lib/ModuleFilenameHelpers.js +4 -2
  58. package/lib/ModuleGraph.js +3 -0
  59. package/lib/ModuleGraphConnection.js +10 -1
  60. package/lib/ModuleHashingError.js +2 -0
  61. package/lib/ModuleInfoHeaderPlugin.js +6 -1
  62. package/lib/ModuleNotFoundError.js +1 -0
  63. package/lib/ModuleParseError.js +5 -1
  64. package/lib/ModuleProfile.js +1 -1
  65. package/lib/ModuleRestoreError.js +2 -0
  66. package/lib/ModuleSourceTypeConstants.js +1 -11
  67. package/lib/ModuleStoreError.js +2 -0
  68. package/lib/ModuleWarning.js +3 -1
  69. package/lib/MultiCompiler.js +11 -7
  70. package/lib/MultiWatching.js +2 -2
  71. package/lib/NoModeWarning.js +1 -0
  72. package/lib/NodeStuffInWebError.js +1 -0
  73. package/lib/NormalModule.js +28 -5
  74. package/lib/NormalModuleFactory.js +20 -4
  75. package/lib/OptionsApply.js +3 -1
  76. package/lib/ProgressPlugin.js +4 -0
  77. package/lib/RawModule.js +2 -0
  78. package/lib/RuntimeModule.js +10 -0
  79. package/lib/RuntimePlugin.js +7 -9
  80. package/lib/RuntimeTemplate.js +14 -7
  81. package/lib/SourceMapDevToolPlugin.js +30 -23
  82. package/lib/Template.js +10 -5
  83. package/lib/TemplatedPathPlugin.js +4 -2
  84. package/lib/UnhandledSchemeError.js +1 -0
  85. package/lib/UnsupportedFeatureWarning.js +3 -0
  86. package/lib/WarnDeprecatedOptionPlugin.js +1 -0
  87. package/lib/WatchIgnorePlugin.js +1 -1
  88. package/lib/Watching.js +5 -0
  89. package/lib/WebpackError.js +4 -0
  90. package/lib/WebpackOptionsApply.js +61 -41
  91. package/lib/asset/AssetBytesGenerator.js +1 -0
  92. package/lib/asset/AssetGenerator.js +18 -3
  93. package/lib/asset/AssetModulesPlugin.js +33 -2
  94. package/lib/asset/AssetParser.js +4 -0
  95. package/lib/asset/AssetSourceGenerator.js +1 -0
  96. package/lib/asset/RawDataUrlModule.js +4 -0
  97. package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -1
  98. package/lib/buildChunkGraph.js +31 -2
  99. package/lib/cache/MemoryWithGcCachePlugin.js +1 -0
  100. package/lib/cache/PackFileCacheStrategy.js +41 -8
  101. package/lib/cache/getLazyHashedEtag.js +13 -4
  102. package/lib/cache/mergeEtags.js +3 -1
  103. package/lib/cli.js +3 -1
  104. package/lib/config/defaults.js +65 -44
  105. package/lib/config/normalization.js +96 -0
  106. package/lib/container/ContainerEntryDependency.js +3 -0
  107. package/lib/container/ContainerEntryModule.js +7 -0
  108. package/lib/container/ContainerExposedDependency.js +1 -0
  109. package/lib/container/FallbackDependency.js +1 -0
  110. package/lib/container/FallbackItemDependency.js +1 -0
  111. package/lib/container/FallbackModule.js +4 -0
  112. package/lib/container/HoistContainerReferencesPlugin.js +6 -0
  113. package/lib/container/ModuleFederationPlugin.js +1 -1
  114. package/lib/container/RemoteModule.js +24 -0
  115. package/lib/css/CssGenerator.js +31 -4
  116. package/lib/css/CssModulesPlugin.js +26 -30
  117. package/lib/css/CssParser.js +12 -9
  118. package/lib/debug/ProfilingPlugin.js +1 -0
  119. package/lib/dependencies/AMDDefineDependency.js +3 -1
  120. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +6 -0
  121. package/lib/dependencies/AMDPlugin.js +1 -1
  122. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +7 -1
  123. package/lib/dependencies/CachedConstDependency.js +1 -0
  124. package/lib/dependencies/CommonJsDependencyHelpers.js +2 -0
  125. package/lib/dependencies/CommonJsExportRequireDependency.js +1 -0
  126. package/lib/dependencies/CommonJsFullRequireDependency.js +2 -0
  127. package/lib/dependencies/CommonJsImportsParserPlugin.js +3 -0
  128. package/lib/dependencies/CommonJsRequireContextDependency.js +2 -2
  129. package/lib/dependencies/CommonJsSelfReferenceDependency.js +1 -0
  130. package/lib/dependencies/ConstDependency.js +1 -0
  131. package/lib/dependencies/ContextDependencyHelpers.js +11 -4
  132. package/lib/dependencies/ContextElementDependency.js +1 -0
  133. package/lib/dependencies/CriticalDependencyWarning.js +1 -0
  134. package/lib/dependencies/CssIcssExportDependency.js +7 -4
  135. package/lib/dependencies/CssIcssSymbolDependency.js +1 -0
  136. package/lib/dependencies/CssUrlDependency.js +2 -3
  137. package/lib/dependencies/ExternalModuleInitFragment.js +4 -1
  138. package/lib/dependencies/ExternalModuleInitFragmentDependency.js +0 -9
  139. package/lib/dependencies/HarmonyAcceptDependency.js +3 -0
  140. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +3 -1
  141. package/lib/dependencies/HarmonyExportExpressionDependency.js +4 -0
  142. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +8 -1
  143. package/lib/dependencies/HarmonyExportInitFragment.js +17 -3
  144. package/lib/dependencies/HarmonyExportSpecifierDependency.js +4 -0
  145. package/lib/dependencies/HarmonyImportDependency.js +1 -1
  146. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +269 -5
  147. package/lib/dependencies/HarmonyImportSpecifierDependency.js +22 -3
  148. package/lib/dependencies/ImportDependency.js +1 -0
  149. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +1 -0
  150. package/lib/dependencies/ImportMetaPlugin.js +53 -11
  151. package/lib/dependencies/ImportParserPlugin.js +7 -12
  152. package/lib/dependencies/LoaderPlugin.js +3 -0
  153. package/lib/dependencies/ModuleDecoratorDependency.js +1 -0
  154. package/lib/dependencies/ModuleDependency.js +1 -0
  155. package/lib/dependencies/ModuleInitFragmentDependency.js +87 -0
  156. package/lib/dependencies/ProvidedDependency.js +1 -0
  157. package/lib/dependencies/RequireContextPlugin.js +1 -0
  158. package/lib/dependencies/RequireEnsureDependenciesBlock.js +1 -1
  159. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +7 -2
  160. package/lib/dependencies/RuntimeRequirementsDependency.js +1 -0
  161. package/lib/dependencies/WorkerDependency.js +9 -3
  162. package/lib/dependencies/WorkerPlugin.js +1 -0
  163. package/lib/dependencies/getFunctionExpression.js +3 -1
  164. package/lib/electron/ElectronTargetPlugin.js +3 -1
  165. package/lib/errors/BuildCycleError.js +4 -1
  166. package/lib/esm/ModuleChunkFormatPlugin.js +6 -4
  167. package/lib/esm/ModuleChunkLoadingPlugin.js +1 -0
  168. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +1 -0
  169. package/lib/hmr/LazyCompilationPlugin.js +5 -0
  170. package/lib/hmr/lazyCompilationBackend.js +3 -2
  171. package/lib/ids/ChunkModuleIdRangePlugin.js +9 -7
  172. package/lib/ids/DeterministicChunkIdsPlugin.js +1 -0
  173. package/lib/ids/DeterministicModuleIdsPlugin.js +1 -0
  174. package/lib/ids/HashedModuleIdsPlugin.js +3 -8
  175. package/lib/ids/IdHelpers.js +10 -8
  176. package/lib/ids/NamedChunkIdsPlugin.js +7 -5
  177. package/lib/ids/NamedModuleIdsPlugin.js +1 -0
  178. package/lib/ids/OccurrenceChunkIdsPlugin.js +2 -2
  179. package/lib/ids/OccurrenceModuleIdsPlugin.js +18 -10
  180. package/lib/ids/SyncModuleIdsPlugin.js +30 -20
  181. package/lib/index.js +2 -2
  182. package/lib/javascript/BasicEvaluatedExpression.js +1 -0
  183. package/lib/javascript/EnableChunkLoadingPlugin.js +5 -2
  184. package/lib/javascript/JavascriptModulesPlugin.js +29 -8
  185. package/lib/javascript/JavascriptParser.js +47 -14
  186. package/lib/json/JsonGenerator.js +1 -0
  187. package/lib/json/JsonParser.js +9 -2
  188. package/lib/library/AbstractLibraryPlugin.js +4 -1
  189. package/lib/library/AmdLibraryPlugin.js +2 -1
  190. package/lib/library/AssignLibraryPlugin.js +6 -2
  191. package/lib/library/EnableLibraryPlugin.js +1 -0
  192. package/lib/library/ExportPropertyLibraryPlugin.js +1 -1
  193. package/lib/library/JsonpLibraryPlugin.js +1 -1
  194. package/lib/library/ModuleLibraryPlugin.js +130 -13
  195. package/lib/library/SystemLibraryPlugin.js +4 -1
  196. package/lib/library/UmdLibraryPlugin.js +4 -3
  197. package/lib/logging/Logger.js +9 -5
  198. package/lib/logging/createConsoleLogger.js +4 -0
  199. package/lib/logging/truncateArgs.js +1 -1
  200. package/lib/node/CommonJsChunkLoadingPlugin.js +6 -4
  201. package/lib/node/NodeEnvironmentPlugin.js +1 -0
  202. package/lib/node/NodeTargetPlugin.js +10 -1
  203. package/lib/node/NodeTemplatePlugin.js +1 -0
  204. package/lib/node/NodeWatchFileSystem.js +6 -0
  205. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +1 -0
  206. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +1 -0
  207. package/lib/node/ReadFileCompileWasmPlugin.js +1 -0
  208. package/lib/node/RequireChunkLoadingRuntimeModule.js +1 -0
  209. package/lib/node/nodeConsole.js +18 -1
  210. package/lib/optimize/AggressiveMergingPlugin.js +2 -1
  211. package/lib/optimize/AggressiveSplittingPlugin.js +15 -6
  212. package/lib/optimize/ConcatenatedModule.js +33 -19
  213. package/lib/optimize/FlagIncludedChunksPlugin.js +11 -1
  214. package/lib/optimize/InnerGraph.js +5 -3
  215. package/lib/optimize/InnerGraphPlugin.js +25 -25
  216. package/lib/optimize/LimitChunkCountPlugin.js +3 -2
  217. package/lib/optimize/MangleExportsPlugin.js +14 -2
  218. package/lib/optimize/MergeDuplicateChunksPlugin.js +5 -1
  219. package/lib/optimize/MinChunkSizePlugin.js +5 -2
  220. package/lib/optimize/ModuleConcatenationPlugin.js +19 -4
  221. package/lib/optimize/RealContentHashPlugin.js +37 -27
  222. package/lib/optimize/RemoveParentModulesPlugin.js +12 -3
  223. package/lib/optimize/RuntimeChunkPlugin.js +3 -5
  224. package/lib/optimize/SideEffectsFlagPlugin.js +3 -0
  225. package/lib/optimize/SplitChunksPlugin.js +23 -5
  226. package/lib/performance/AssetsOverSizeLimitWarning.js +6 -2
  227. package/lib/performance/EntrypointsOverSizeLimitWarning.js +6 -2
  228. package/lib/performance/NoAsyncChunksWarning.js +1 -0
  229. package/lib/performance/SizeLimitsPlugin.js +6 -6
  230. package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +2 -0
  231. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +3 -1
  232. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +1 -0
  233. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +1 -0
  234. package/lib/rules/BasicEffectRulePlugin.js +2 -0
  235. package/lib/rules/BasicMatcherRulePlugin.js +3 -0
  236. package/lib/rules/ObjectMatcherRulePlugin.js +5 -1
  237. package/lib/rules/RuleSetCompiler.js +6 -0
  238. package/lib/runtime/AsyncModuleRuntimeModule.js +1 -0
  239. package/lib/runtime/ChunkNameRuntimeModule.js +1 -0
  240. package/lib/runtime/CompatRuntimeModule.js +1 -0
  241. package/lib/runtime/EnsureChunkRuntimeModule.js +1 -0
  242. package/lib/runtime/GetChunkFilenameRuntimeModule.js +5 -0
  243. package/lib/runtime/GetFullHashRuntimeModule.js +1 -0
  244. package/lib/runtime/GetMainFilenameRuntimeModule.js +2 -0
  245. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +1 -0
  246. package/lib/runtime/LoadScriptRuntimeModule.js +2 -0
  247. package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +16 -32
  248. package/lib/runtime/PublicPathRuntimeModule.js +1 -0
  249. package/lib/runtime/StartupChunkDependenciesPlugin.js +2 -0
  250. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +1 -0
  251. package/lib/runtime/StartupEntrypointRuntimeModule.js +1 -0
  252. package/lib/schemes/HttpUriPlugin.js +39 -20
  253. package/lib/schemes/VirtualUrlPlugin.js +28 -2
  254. package/lib/serialization/BinaryMiddleware.js +4 -0
  255. package/lib/serialization/FileMiddleware.js +9 -4
  256. package/lib/serialization/ObjectMiddleware.js +34 -11
  257. package/lib/serialization/PlainObjectSerializer.js +2 -0
  258. package/lib/sharing/ConsumeSharedModule.js +60 -0
  259. package/lib/sharing/ConsumeSharedPlugin.js +5 -4
  260. package/lib/sharing/ProvideSharedModule.js +4 -0
  261. package/lib/sharing/ProvideSharedPlugin.js +24 -25
  262. package/lib/sharing/resolveMatchedConfigs.js +2 -2
  263. package/lib/sharing/utils.js +8 -6
  264. package/lib/stats/DefaultStatsFactoryPlugin.js +20 -12
  265. package/lib/stats/DefaultStatsPrinterPlugin.js +6 -5
  266. package/lib/stats/StatsFactory.js +2 -2
  267. package/lib/url/URLParserPlugin.js +5 -3
  268. package/lib/util/AppendOnlyStackedSet.js +57 -0
  269. package/lib/util/Hash.js +1 -0
  270. package/lib/util/IterableHelpers.js +1 -0
  271. package/lib/util/LazyBucketSortedSet.js +1 -0
  272. package/lib/util/LazySet.js +1 -0
  273. package/lib/util/ParallelismFactorCalculator.js +1 -0
  274. package/lib/util/SortableSet.js +1 -0
  275. package/lib/util/StringXor.js +1 -0
  276. package/lib/util/binarySearchBounds.js +15 -8
  277. package/lib/util/chainedImports.js +1 -1
  278. package/lib/util/cleverMerge.js +6 -1
  279. package/lib/util/comparators.js +21 -1
  280. package/lib/util/compileBooleanMatcher.js +3 -3
  281. package/lib/util/concatenate.js +3 -2
  282. package/lib/util/conventions.js +3 -2
  283. package/lib/util/deterministicGrouping.js +13 -1
  284. package/lib/util/extractSourceMap.js +12 -13
  285. package/lib/util/fs.js +15 -19
  286. package/lib/util/hash/BatchedHash.js +4 -0
  287. package/lib/util/hash/BulkUpdateHash.js +8 -1
  288. package/lib/util/hash/hash-digest.js +1 -0
  289. package/lib/util/hash/wasm-hash.js +18 -2
  290. package/lib/util/identifier.js +7 -2
  291. package/lib/util/magicComment.js +1 -1
  292. package/lib/util/propertyName.js +1 -1
  293. package/lib/util/registerExternalSerializer.js +1 -0
  294. package/lib/util/runtime.js +15 -1
  295. package/lib/util/semver.js +1 -0
  296. package/lib/util/serialization.js +2 -2
  297. package/lib/wasm/EnableWasmLoadingPlugin.js +2 -0
  298. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +11 -3
  299. package/lib/wasm-async/AsyncWebAssemblyGenerator.js +1 -0
  300. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +3 -2
  301. package/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js +5 -1
  302. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +3 -0
  303. package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +2 -0
  304. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +7 -3
  305. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +2 -2
  306. package/lib/wasm-sync/WebAssemblyParser.js +3 -1
  307. package/lib/web/FetchCompileWasmPlugin.js +1 -0
  308. package/lib/web/JsonpChunkLoadingPlugin.js +1 -0
  309. package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -0
  310. package/lib/webpack.js +16 -4
  311. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +1 -0
  312. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +2 -0
  313. package/package.json +33 -36
  314. package/schemas/WebpackOptions.check.js +1 -1
  315. package/schemas/WebpackOptions.json +121 -55
  316. package/schemas/plugins/BannerPlugin.json +2 -2
  317. package/schemas/plugins/IgnorePlugin.json +1 -1
  318. package/schemas/plugins/ManifestPlugin.json +3 -3
  319. package/schemas/plugins/ProgressPlugin.json +1 -1
  320. package/schemas/plugins/SourceMapDevToolPlugin.json +2 -2
  321. package/schemas/plugins/schemes/HttpUriPlugin.json +1 -1
  322. package/schemas/plugins/schemes/VirtualUrlPlugin.json +3 -3
  323. package/types.d.ts +440 -137
@@ -33,7 +33,7 @@ const THIRTY_TWO_BIGINT = BigInt(32);
33
33
  * Parses the module mask and returns the modules represented by it
34
34
  * @param {bigint} mask the module mask
35
35
  * @param {Module[]} ordinalModules the modules in the order they were added to the mask (LSB is index 0)
36
- * @returns {Generator<Module>} the modules represented by the mask
36
+ * @returns {Generator<Module, undefined, undefined>} the modules represented by the mask
37
37
  */
38
38
  function* getModulesFromMask(mask, ordinalModules) {
39
39
  let offset = 31;
@@ -74,10 +74,13 @@ class RemoveParentModulesPlugin {
74
74
  */
75
75
  const handler = (chunks, chunkGroups) => {
76
76
  const chunkGraph = compilation.chunkGraph;
77
+ /** @type {Set<ChunkGroup>} */
77
78
  const queue = new Set();
79
+ /** @type {WeakMap<ChunkGroup, bigint | undefined>} */
78
80
  const availableModulesMap = new WeakMap();
79
81
 
80
82
  let nextModuleMask = ONE_BIGINT;
83
+ /** @type {WeakMap<Module, bigint>} */
81
84
  const maskByModule = new WeakMap();
82
85
  /** @type {Module[]} */
83
86
  const ordinalModules = [];
@@ -99,6 +102,7 @@ class RemoveParentModulesPlugin {
99
102
  };
100
103
 
101
104
  // Initialize masks by chunk and by chunk group for quicker comparisons
105
+ /** @type {WeakMap<Chunk, bigint>} */
102
106
  const chunkMasks = new WeakMap();
103
107
  for (const chunk of chunks) {
104
108
  let mask = ZERO_BIGINT;
@@ -109,6 +113,7 @@ class RemoveParentModulesPlugin {
109
113
  chunkMasks.set(chunk, mask);
110
114
  }
111
115
 
116
+ /** @type {WeakMap<ChunkGroup, bigint>} */
112
117
  const chunkGroupMasks = new WeakMap();
113
118
  for (const chunkGroup of chunkGroups) {
114
119
  let mask = ZERO_BIGINT;
@@ -143,7 +148,8 @@ class RemoveParentModulesPlugin {
143
148
  const availableModulesInParent = availableModulesMap.get(parent);
144
149
  if (availableModulesInParent !== undefined) {
145
150
  const parentMask =
146
- availableModulesInParent | chunkGroupMasks.get(parent);
151
+ availableModulesInParent |
152
+ /** @type {bigint} */ (chunkGroupMasks.get(parent));
147
153
  // If we know the available modules in parent: process these
148
154
  if (availableModulesMask === undefined) {
149
155
  // if we have not own info yet: create new entry
@@ -181,7 +187,10 @@ class RemoveParentModulesPlugin {
181
187
  );
182
188
  if (availableModulesSets.includes(undefined)) continue; // No info about this chunk group
183
189
 
184
- const availableModulesMask = intersectMasks(availableModulesSets);
190
+ const availableModulesMask = intersectMasks(
191
+ /** @type {bigint[]} */
192
+ (availableModulesSets)
193
+ );
185
194
  const toRemoveMask = chunkMask & availableModulesMask;
186
195
  if (toRemoveMask !== ZERO_BIGINT) {
187
196
  for (const module of getModulesFromMask(
@@ -16,9 +16,9 @@ class RuntimeChunkPlugin {
16
16
  /**
17
17
  * @param {{ name?: RuntimeChunkFunction }=} options options
18
18
  */
19
- constructor(options) {
19
+ constructor(options = {}) {
20
+ /** @type {{ name: string | RuntimeChunkFunction }} */
20
21
  this.options = {
21
- /** @type {RuntimeChunkFunction} */
22
22
  name: (entrypoint) => `runtime~${entrypoint.name}`,
23
23
  ...options
24
24
  };
@@ -38,9 +38,7 @@ class RuntimeChunkPlugin {
38
38
  (compilation.entries.get(entryName));
39
39
  if (data.options.runtime === undefined && !data.options.dependOn) {
40
40
  // Determine runtime chunk name
41
- let name =
42
- /** @type {string | RuntimeChunkFunction} */
43
- (this.options.name);
41
+ let name = this.options.name;
44
42
  if (typeof name === "function") {
45
43
  name = name({ name: entryName });
46
44
  }
@@ -68,6 +68,7 @@ class SideEffectsFlagPlugin {
68
68
  * @param {boolean} analyseSource analyse source code for side effects
69
69
  */
70
70
  constructor(analyseSource = true) {
71
+ /** @type {boolean} */
71
72
  this._analyseSource = analyseSource;
72
73
  }
73
74
 
@@ -277,6 +278,7 @@ class SideEffectsFlagPlugin {
277
278
 
278
279
  logger.time("update dependencies");
279
280
 
281
+ /** @type {Set<Module>} */
280
282
  const optimizedModules = new Set();
281
283
 
282
284
  /**
@@ -291,6 +293,7 @@ class SideEffectsFlagPlugin {
291
293
  module
292
294
  )) {
293
295
  const dep = connection.dependency;
296
+ /** @type {boolean} */
294
297
  let isReexport;
295
298
  if (
296
299
  (isReexport =
@@ -22,7 +22,6 @@ const memoize = require("../util/memoize");
22
22
  const MinMaxSizeWarning = require("./MinMaxSizeWarning");
23
23
 
24
24
  /** @typedef {import("../../declarations/WebpackOptions").OptimizationSplitChunksCacheGroup} OptimizationSplitChunksCacheGroup */
25
- /** @typedef {import("../../declarations/WebpackOptions").OptimizationSplitChunksGetCacheGroups} OptimizationSplitChunksGetCacheGroups */
26
25
  /** @typedef {import("../../declarations/WebpackOptions").OptimizationSplitChunksOptions} OptimizationSplitChunksOptions */
27
26
  /** @typedef {import("../../declarations/WebpackOptions").OptimizationSplitChunksSizes} OptimizationSplitChunksSizes */
28
27
  /** @typedef {import("../config/defaults").OutputNormalizedWithDefaults} OutputOptions */
@@ -36,6 +35,7 @@ const MinMaxSizeWarning = require("./MinMaxSizeWarning");
36
35
  /** @typedef {import("../TemplatedPathPlugin").TemplatePath} TemplatePath */
37
36
  /** @typedef {import("../util/deterministicGrouping").GroupedItems<Module>} DeterministicGroupingGroupedItemsForModule */
38
37
  /** @typedef {import("../util/deterministicGrouping").Options<Module>} DeterministicGroupingOptionsForModule */
38
+ /** @typedef {import("../util/deterministicGrouping").Sizes} Sizes */
39
39
 
40
40
  /**
41
41
  * @callback ChunkFilterFn
@@ -123,6 +123,8 @@ const MinMaxSizeWarning = require("./MinMaxSizeWarning");
123
123
  * @property {ChunkGraph} chunkGraph
124
124
  */
125
125
 
126
+ /** @typedef {(module: Module) => OptimizationSplitChunksCacheGroup | OptimizationSplitChunksCacheGroup[] | void} RawGetCacheGroups */
127
+
126
128
  /**
127
129
  * @callback GetCacheGroups
128
130
  * @param {Module} module
@@ -220,9 +222,10 @@ const getRequests = (chunk) => {
220
222
  * @returns {T} result
221
223
  */
222
224
  const mapObject = (obj, fn) => {
225
+ /** @type {T} */
223
226
  const newObj = Object.create(null);
224
227
  for (const key of Object.keys(obj)) {
225
- newObj[key] = fn(
228
+ newObj[/** @type {keyof T} */ (key)] = fn(
226
229
  obj[/** @type {keyof T} */ (key)],
227
230
  /** @type {keyof T} */
228
231
  (key)
@@ -454,7 +457,7 @@ const normalizeChunksFilter = (chunks) => {
454
457
  };
455
458
 
456
459
  /**
457
- * @param {undefined | GetCacheGroups | Record<string, false | string | RegExp | OptimizationSplitChunksGetCacheGroups | OptimizationSplitChunksCacheGroup>} cacheGroups the cache group options
460
+ * @param {undefined | GetCacheGroups | Record<string, false | string | RegExp | RawGetCacheGroups | OptimizationSplitChunksCacheGroup>} cacheGroups the cache group options
458
461
  * @param {DefaultSizeTypes} defaultSizeTypes the default size types
459
462
  * @returns {GetCacheGroups} a function to get the cache groups
460
463
  */
@@ -478,6 +481,7 @@ const normalizeCacheGroups = (cacheGroups, defaultSizeTypes) => {
478
481
  }
479
482
  });
480
483
  } else if (typeof option === "function") {
484
+ /** @type {WeakMap<OptimizationSplitChunksCacheGroup, CacheGroupSource>} */
481
485
  const cache = new WeakMap();
482
486
  handlers.push((module, context, results) => {
483
487
  const result = option(module);
@@ -530,6 +534,8 @@ const normalizeCacheGroups = (cacheGroups, defaultSizeTypes) => {
530
534
  return () => null;
531
535
  };
532
536
 
537
+ /** @typedef {(module: Module, context: CacheGroupsContext) => boolean} CheckTestFn */
538
+
533
539
  /**
534
540
  * @param {OptimizationSplitChunksCacheGroup["test"]} test test option
535
541
  * @param {Module} module the module
@@ -553,6 +559,8 @@ const checkTest = (test, module, context) => {
553
559
  return false;
554
560
  };
555
561
 
562
+ /** @typedef {(type: string) => boolean} CheckModuleTypeFn */
563
+
556
564
  /**
557
565
  * @param {OptimizationSplitChunksCacheGroup["type"]} test type option
558
566
  * @param {Module} module the module
@@ -574,6 +582,8 @@ const checkModuleType = (test, module) => {
574
582
  return false;
575
583
  };
576
584
 
585
+ /** @typedef {(layer: string | null) => boolean} CheckModuleLayerFn */
586
+
577
587
  /**
578
588
  * @param {OptimizationSplitChunksCacheGroup["layer"]} test type option
579
589
  * @param {Module} module the module
@@ -868,7 +878,7 @@ module.exports = class SplitChunksPlugin {
868
878
  index <<= ONE;
869
879
  }
870
880
  /**
871
- * @param {Iterable<Chunk>} chunks list of chunks
881
+ * @param {Iterable<Chunk, undefined, undefined>} chunks list of chunks
872
882
  * @returns {bigint | Chunk} key of the chunks
873
883
  */
874
884
  const getKey = (chunks) => {
@@ -921,6 +931,7 @@ module.exports = class SplitChunksPlugin {
921
931
  */
922
932
  const groupChunksByExports = (module) => {
923
933
  const exportsInfo = moduleGraph.getExportsInfo(module);
934
+ /** @type {Map<string, Chunk[]>} */
924
935
  const groupedByUsedExports = new Map();
925
936
  for (const chunk of chunkGraph.getModuleChunksIterable(module)) {
926
937
  const key = exportsInfo.getUsageKey(chunk.runtime);
@@ -1082,7 +1093,8 @@ module.exports = class SplitChunksPlugin {
1082
1093
  * @property {bigint | Chunk} key a key of the list
1083
1094
  */
1084
1095
 
1085
- /** @type {WeakMap<ChunkSet | Chunk, WeakMap<ChunkFilterFn, SelectedChunksResult>>} */
1096
+ /** @typedef {WeakMap<ChunkFilterFn, SelectedChunksResult>} ChunkMap */
1097
+ /** @type {WeakMap<ChunkSet | Chunk, ChunkMap>} */
1086
1098
  const selectedChunksCacheByChunksSet = new WeakMap();
1087
1099
 
1088
1100
  /**
@@ -1095,6 +1107,7 @@ module.exports = class SplitChunksPlugin {
1095
1107
  const getSelectedChunks = (chunks, chunkFilter) => {
1096
1108
  let entry = selectedChunksCacheByChunksSet.get(chunks);
1097
1109
  if (entry === undefined) {
1110
+ /** @type {ChunkMap} */
1098
1111
  entry = new WeakMap();
1099
1112
  selectedChunksCacheByChunksSet.set(chunks, entry);
1100
1113
  }
@@ -1392,7 +1405,9 @@ module.exports = class SplitChunksPlugin {
1392
1405
 
1393
1406
  while (chunksInfoMap.size > 0) {
1394
1407
  // Find best matching entry
1408
+ /** @type {undefined | string} */
1395
1409
  let bestEntryKey;
1410
+ /** @type {undefined | ChunksInfoItem} */
1396
1411
  let bestEntry;
1397
1412
  for (const pair of chunksInfoMap) {
1398
1413
  const key = pair[0];
@@ -1471,6 +1486,7 @@ module.exports = class SplitChunksPlugin {
1471
1486
  item.cacheGroup._conditionalEnforce &&
1472
1487
  checkMinSize(item.sizes, item.cacheGroup.enforceSizeThreshold);
1473
1488
 
1489
+ /** @type {Set<Chunk>} */
1474
1490
  const usedChunks = new Set(item.chunks);
1475
1491
 
1476
1492
  // Check if maxRequests condition can be fulfilled
@@ -1533,6 +1549,7 @@ module.exports = class SplitChunksPlugin {
1533
1549
  usedChunks.size === 1
1534
1550
  ) {
1535
1551
  const [chunk] = usedChunks;
1552
+ /** @type {SplitChunksSizes} */
1536
1553
  const chunkSizes = Object.create(null);
1537
1554
  for (const module of chunkGraph.getChunkModulesIterable(chunk)) {
1538
1555
  if (!item.modules.has(module)) {
@@ -1763,6 +1780,7 @@ module.exports = class SplitChunksPlugin {
1763
1780
  return key;
1764
1781
  },
1765
1782
  getSize(module) {
1783
+ /** @type {Sizes} */
1766
1784
  const size = Object.create(null);
1767
1785
  for (const key of module.getSourceTypes()) {
1768
1786
  size[key] = module.size(key);
@@ -10,7 +10,7 @@ const WebpackError = require("../WebpackError");
10
10
 
11
11
  /** @typedef {import("./SizeLimitsPlugin").AssetDetails} AssetDetails */
12
12
 
13
- module.exports = class AssetsOverSizeLimitWarning extends WebpackError {
13
+ class AssetsOverSizeLimitWarning extends WebpackError {
14
14
  /**
15
15
  * @param {AssetDetails[]} assetsOverSizeLimit the assets
16
16
  * @param {number} assetLimit the size limit
@@ -26,7 +26,11 @@ module.exports = class AssetsOverSizeLimitWarning extends WebpackError {
26
26
  This can impact web performance.
27
27
  Assets: ${assetLists}`);
28
28
 
29
+ /** @type {string} */
29
30
  this.name = "AssetsOverSizeLimitWarning";
30
31
  this.assets = assetsOverSizeLimit;
31
32
  }
32
- };
33
+ }
34
+
35
+ /** @type {typeof AssetsOverSizeLimitWarning} */
36
+ module.exports = AssetsOverSizeLimitWarning;
@@ -10,7 +10,7 @@ const WebpackError = require("../WebpackError");
10
10
 
11
11
  /** @typedef {import("./SizeLimitsPlugin").EntrypointDetails} EntrypointDetails */
12
12
 
13
- module.exports = class EntrypointsOverSizeLimitWarning extends WebpackError {
13
+ class EntrypointsOverSizeLimitWarning extends WebpackError {
14
14
  /**
15
15
  * @param {EntrypointDetails[]} entrypoints the entrypoints
16
16
  * @param {number} entrypointLimit the size limit
@@ -29,7 +29,11 @@ module.exports = class EntrypointsOverSizeLimitWarning extends WebpackError {
29
29
  )}). This can impact web performance.
30
30
  Entrypoints:${entrypointList}\n`);
31
31
 
32
+ /** @type {string} */
32
33
  this.name = "EntrypointsOverSizeLimitWarning";
33
34
  this.entrypoints = entrypoints;
34
35
  }
35
- };
36
+ }
37
+
38
+ /** @type {typeof EntrypointsOverSizeLimitWarning} */
39
+ module.exports = EntrypointsOverSizeLimitWarning;
@@ -15,6 +15,7 @@ module.exports = class NoAsyncChunksWarning extends WebpackError {
15
15
  "For more info visit https://webpack.js.org/guides/code-splitting/"
16
16
  );
17
17
 
18
+ /** @type {string} */
18
19
  this.name = "NoAsyncChunksWarning";
19
20
  }
20
21
  };
@@ -34,12 +34,9 @@ const NoAsyncChunksWarning = require("./NoAsyncChunksWarning");
34
34
  /** @type {WeakSet<Entrypoint | ChunkGroup | Source>} */
35
35
  const isOverSizeLimitSet = new WeakSet();
36
36
 
37
- /**
38
- * @param {Asset["name"]} name the name
39
- * @param {Asset["source"]} source the source
40
- * @param {Asset["info"]} info the info
41
- * @returns {boolean} result
42
- */
37
+ /** @typedef {(name: Asset["name"], source: Asset["source"], assetInfo: Asset["info"]) => boolean} AssetFilter */
38
+
39
+ /** @type {AssetFilter} */
43
40
  const excludeSourceMap = (name, source, info) => !info.development;
44
41
 
45
42
  const PLUGIN_NAME = "SizeLimitsPlugin";
@@ -50,8 +47,11 @@ module.exports = class SizeLimitsPlugin {
50
47
  */
51
48
  constructor(options) {
52
49
  this.hints = options.hints;
50
+ /** @type {number | undefined} */
53
51
  this.maxAssetSize = options.maxAssetSize;
52
+ /** @type {number | undefined} */
54
53
  this.maxEntrypointSize = options.maxEntrypointSize;
54
+ /** @type {AssetFilter | undefined} */
55
55
  this.assetFilter = options.assetFilter;
56
56
  }
57
57
 
@@ -17,7 +17,9 @@ class ChunkPrefetchFunctionRuntimeModule extends RuntimeModule {
17
17
  */
18
18
  constructor(type, runtimeFunction, runtimeHandlers) {
19
19
  super(`chunk ${type} function`);
20
+ /** @type {string} */
20
21
  this.runtimeFunction = runtimeFunction;
22
+ /** @type {string} */
21
23
  this.runtimeHandlers = runtimeHandlers;
22
24
  }
23
25
 
@@ -9,14 +9,16 @@ const RuntimeModule = require("../RuntimeModule");
9
9
  const Template = require("../Template");
10
10
 
11
11
  /** @typedef {import("../Chunk")} Chunk */
12
+ /** @typedef {import("../Chunk").ChunkChildOfTypeInOrder} ChunkChildOfTypeInOrder */
12
13
  /** @typedef {import("../Compilation")} Compilation */
13
14
 
14
15
  class ChunkPrefetchStartupRuntimeModule extends RuntimeModule {
15
16
  /**
16
- * @param {{ onChunks: Chunk[], chunks: Set<Chunk> }[]} startupChunks chunk ids to trigger when chunks are loaded
17
+ * @param {ChunkChildOfTypeInOrder[]} startupChunks chunk ids to trigger when chunks are loaded
17
18
  */
18
19
  constructor(startupChunks) {
19
20
  super("startup prefetch", RuntimeModule.STAGE_TRIGGER);
21
+ /** @type {ChunkChildOfTypeInOrder[]} */
20
22
  this.startupChunks = startupChunks;
21
23
  }
22
24
 
@@ -17,6 +17,7 @@ class ChunkPrefetchTriggerRuntimeModule extends RuntimeModule {
17
17
  */
18
18
  constructor(chunkMap) {
19
19
  super("chunk prefetch trigger", RuntimeModule.STAGE_TRIGGER);
20
+ /** @type {ChunkChildIdsByOrdersMap} */
20
21
  this.chunkMap = chunkMap;
21
22
  }
22
23
 
@@ -17,6 +17,7 @@ class ChunkPreloadTriggerRuntimeModule extends RuntimeModule {
17
17
  */
18
18
  constructor(chunkMap) {
19
19
  super("chunk preload trigger", RuntimeModule.STAGE_TRIGGER);
20
+ /** @type {ChunkChildIdsByOrdersMap} */
20
21
  this.chunkMap = chunkMap;
21
22
  }
22
23
 
@@ -24,7 +24,9 @@ class BasicEffectRulePlugin {
24
24
  * @param {string=} effectType the effect type
25
25
  */
26
26
  constructor(ruleProperty, effectType) {
27
+ /** @type {BasicEffectRuleKeys} */
27
28
  this.ruleProperty = ruleProperty;
29
+ /** @type {string | BasicEffectRuleKeys} */
28
30
  this.effectType = effectType || ruleProperty;
29
31
  }
30
32
 
@@ -27,8 +27,11 @@ class BasicMatcherRulePlugin {
27
27
  * @param {boolean=} invert if true, inverts the condition
28
28
  */
29
29
  constructor(ruleProperty, dataProperty, invert) {
30
+ /** @type {BasicMatcherRuleKeys} */
30
31
  this.ruleProperty = ruleProperty;
32
+ /** @type {string | BasicMatcherRuleKeys} */
31
33
  this.dataProperty = dataProperty || ruleProperty;
34
+ /** @type {boolean} */
32
35
  this.invert = invert || false;
33
36
  }
34
37
 
@@ -18,18 +18,22 @@
18
18
  */
19
19
 
20
20
  /** @typedef {KeysOfTypes<RuleSetRule, { [k: string]: RuleSetConditionOrConditions }>} ObjectMatcherRuleKeys */
21
+ /** @typedef {keyof EffectData} DataProperty */
21
22
 
22
23
  const PLUGIN_NAME = "ObjectMatcherRulePlugin";
23
24
 
24
25
  class ObjectMatcherRulePlugin {
25
26
  /**
26
27
  * @param {ObjectMatcherRuleKeys} ruleProperty the rule property
27
- * @param {keyof EffectData=} dataProperty the data property
28
+ * @param {DataProperty=} dataProperty the data property
28
29
  * @param {RuleConditionFunction=} additionalConditionFunction need to check
29
30
  */
30
31
  constructor(ruleProperty, dataProperty, additionalConditionFunction) {
32
+ /** @type {ObjectMatcherRuleKeys} */
31
33
  this.ruleProperty = ruleProperty;
34
+ /** @type {DataProperty | ObjectMatcherRuleKeys} */
32
35
  this.dataProperty = dataProperty || ruleProperty;
36
+ /** @type {RuleConditionFunction | undefined} */
33
37
  this.additionalConditionFunction = additionalConditionFunction;
34
38
  }
35
39
 
@@ -9,6 +9,7 @@ const { SyncHook } = require("tapable");
9
9
 
10
10
  /** @typedef {import("enhanced-resolve").ResolveRequest} ResolveRequest */
11
11
  /** @typedef {import("../../declarations/WebpackOptions").Falsy} Falsy */
12
+ /** @typedef {import("../../declarations/WebpackOptions").RuleSetUseItem} RuleSetUseItem */
12
13
  /** @typedef {import("../../declarations/WebpackOptions").RuleSetLoaderOptions} RuleSetLoaderOptions */
13
14
  /** @typedef {import("../../declarations/WebpackOptions").RuleSetRule} RuleSetRule */
14
15
 
@@ -87,6 +88,9 @@ const { SyncHook } = require("tapable");
87
88
 
88
89
  /** @typedef {Set<string>} UnhandledProperties */
89
90
 
91
+ /** @typedef {(data: EffectData) => (RuleSetUseItem | (Falsy | RuleSetUseItem)[])} RuleSetUseFn */
92
+ /** @typedef {(value: string) => boolean} RuleSetConditionFn */
93
+
90
94
  /** @typedef {{ apply: (ruleSetCompiler: RuleSetCompiler) => void }} RuleSetPlugin */
91
95
 
92
96
  class RuleSetCompiler {
@@ -116,6 +120,7 @@ class RuleSetCompiler {
116
120
  * @returns {RuleSet} compiled RuleSet
117
121
  */
118
122
  compile(ruleSet) {
123
+ /** @type {References} */
119
124
  const refs = new Map();
120
125
  const rules = this.compileRules("ruleSet", ruleSet, refs);
121
126
 
@@ -327,6 +332,7 @@ class RuleSetCompiler {
327
332
  );
328
333
  }
329
334
 
335
+ /** @type {Condition[]} */
330
336
  const conditions = [];
331
337
  for (const key of Object.keys(condition)) {
332
338
  const value = condition[key];
@@ -16,6 +16,7 @@ class AsyncModuleRuntimeModule extends HelperRuntimeModule {
16
16
  */
17
17
  constructor(deferInterop = false) {
18
18
  super("async module");
19
+ /** @type {boolean} */
19
20
  this._deferInterop = deferInterop;
20
21
  }
21
22
 
@@ -13,6 +13,7 @@ class ChunkNameRuntimeModule extends RuntimeModule {
13
13
  */
14
14
  constructor(chunkName) {
15
15
  super("chunkName");
16
+ /** @type {string} */
16
17
  this.chunkName = chunkName;
17
18
  }
18
19
 
@@ -14,6 +14,7 @@ const RuntimeModule = require("../RuntimeModule");
14
14
  class CompatRuntimeModule extends RuntimeModule {
15
15
  constructor() {
16
16
  super("compat", RuntimeModule.STAGE_ATTACH);
17
+ /** @type {boolean} */
17
18
  this.fullHash = true;
18
19
  }
19
20
 
@@ -17,6 +17,7 @@ class EnsureChunkRuntimeModule extends RuntimeModule {
17
17
  */
18
18
  constructor(runtimeRequirements) {
19
19
  super("ensure chunk");
20
+ /** @type {ReadOnlyRuntimeRequirements} */
20
21
  this.runtimeRequirements = runtimeRequirements;
21
22
  }
22
23
 
@@ -26,10 +26,15 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
26
26
  */
27
27
  constructor(contentType, name, global, getFilenameForChunk, allChunks) {
28
28
  super(`get ${name} chunk filename`);
29
+ /** @type {string} */
29
30
  this.contentType = contentType;
31
+ /** @type {string} */
30
32
  this.global = global;
33
+ /** @type {(chunk: Chunk) => TemplatePath | false} */
31
34
  this.getFilenameForChunk = getFilenameForChunk;
35
+ /** @type {boolean} */
32
36
  this.allChunks = allChunks;
37
+ /** @type {boolean} */
33
38
  this.dependentHash = true;
34
39
  }
35
40
 
@@ -12,6 +12,7 @@ const RuntimeModule = require("../RuntimeModule");
12
12
  class GetFullHashRuntimeModule extends RuntimeModule {
13
13
  constructor() {
14
14
  super("getFullHash");
15
+ /** @type {boolean} */
15
16
  this.fullHash = true;
16
17
  }
17
18
 
@@ -19,7 +19,9 @@ class GetMainFilenameRuntimeModule extends RuntimeModule {
19
19
  */
20
20
  constructor(name, global, filename) {
21
21
  super(`get ${name} filename`);
22
+ /** @type {string} */
22
23
  this.global = global;
24
+ /** @type {string} */
23
25
  this.filename = filename;
24
26
  }
25
27
 
@@ -17,6 +17,7 @@ class GetTrustedTypesPolicyRuntimeModule extends HelperRuntimeModule {
17
17
  */
18
18
  constructor(runtimeRequirements) {
19
19
  super("trusted types policy");
20
+ /** @type {ReadOnlyRuntimeRequirements} */
20
21
  this.runtimeRequirements = runtimeRequirements;
21
22
  }
22
23
 
@@ -47,7 +47,9 @@ class LoadScriptRuntimeModule extends HelperRuntimeModule {
47
47
  */
48
48
  constructor(withCreateScriptUrl, withFetchPriority) {
49
49
  super("load script");
50
+ /** @type {boolean | undefined} */
50
51
  this._withCreateScriptUrl = withCreateScriptUrl;
52
+ /** @type {boolean | undefined} */
51
53
  this._withFetchPriority = withFetchPriority;
52
54
  }
53
55