webpack 5.85.0 → 5.88.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.

Potentially problematic release.


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

Files changed (249) hide show
  1. package/README.md +5 -2
  2. package/lib/APIPlugin.js +150 -99
  3. package/lib/AsyncDependenciesBlock.js +3 -3
  4. package/lib/BannerPlugin.js +2 -1
  5. package/lib/CaseSensitiveModulesWarning.js +3 -1
  6. package/lib/Chunk.js +35 -17
  7. package/lib/ChunkGraph.js +4 -4
  8. package/lib/ChunkGroup.js +20 -9
  9. package/lib/CompatibilityPlugin.js +50 -30
  10. package/lib/Compilation.js +2 -1
  11. package/lib/Compiler.js +10 -9
  12. package/lib/ConcatenationScope.js +2 -2
  13. package/lib/ConditionalInitFragment.js +11 -1
  14. package/lib/ConstPlugin.js +73 -32
  15. package/lib/ContextModule.js +8 -3
  16. package/lib/ContextModuleFactory.js +1 -0
  17. package/lib/ContextReplacementPlugin.js +13 -0
  18. package/lib/DelegatedModule.js +15 -3
  19. package/lib/DelegatedModuleFactoryPlugin.js +6 -0
  20. package/lib/DependenciesBlock.js +1 -1
  21. package/lib/Dependency.js +11 -5
  22. package/lib/DependencyTemplates.js +1 -1
  23. package/lib/DllEntryPlugin.js +11 -1
  24. package/lib/DllModule.js +6 -0
  25. package/lib/DllReferencePlugin.js +13 -1
  26. package/lib/Entrypoint.js +1 -1
  27. package/lib/ErrorHelpers.js +1 -0
  28. package/lib/EvalSourceMapDevToolPlugin.js +6 -1
  29. package/lib/ExportsInfo.js +22 -4
  30. package/lib/ExportsInfoApiPlugin.js +14 -5
  31. package/lib/ExternalModule.js +20 -8
  32. package/lib/FileSystemInfo.js +52 -24
  33. package/lib/FlagAllModulesAsUsedPlugin.js +6 -1
  34. package/lib/FlagDependencyUsagePlugin.js +3 -1
  35. package/lib/FlagEntryExportAsUsedPlugin.js +4 -0
  36. package/lib/Generator.js +7 -0
  37. package/lib/HotModuleReplacementPlugin.js +8 -0
  38. package/lib/InitFragment.js +28 -5
  39. package/lib/JavascriptMetaInfoPlugin.js +11 -6
  40. package/lib/LibManifestPlugin.js +20 -4
  41. package/lib/Module.js +14 -3
  42. package/lib/ModuleDependencyError.js +4 -2
  43. package/lib/ModuleDependencyWarning.js +4 -2
  44. package/lib/ModuleGraph.js +31 -24
  45. package/lib/ModuleGraphConnection.js +19 -6
  46. package/lib/ModuleInfoHeaderPlugin.js +9 -2
  47. package/lib/ModuleNotFoundError.js +5 -2
  48. package/lib/ModuleProfile.js +1 -0
  49. package/lib/ModuleRestoreError.js +2 -0
  50. package/lib/ModuleStoreError.js +2 -1
  51. package/lib/ModuleTypeConstants.js +7 -0
  52. package/lib/MultiWatching.js +4 -0
  53. package/lib/NodeStuffPlugin.js +32 -6
  54. package/lib/ProgressPlugin.js +71 -15
  55. package/lib/ProvidePlugin.js +13 -4
  56. package/lib/RawModule.js +3 -1
  57. package/lib/RequireJsStuffPlugin.js +7 -0
  58. package/lib/RuntimeGlobals.js +5 -0
  59. package/lib/RuntimeModule.js +3 -3
  60. package/lib/RuntimePlugin.js +6 -3
  61. package/lib/RuntimeTemplate.js +22 -4
  62. package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -0
  63. package/lib/SourceMapDevToolPlugin.js +7 -2
  64. package/lib/UseStrictPlugin.js +10 -3
  65. package/lib/Watching.js +62 -25
  66. package/lib/WebpackError.js +6 -5
  67. package/lib/WebpackIsIncludedPlugin.js +6 -4
  68. package/lib/WebpackOptionsApply.js +4 -2
  69. package/lib/WebpackOptionsDefaulter.js +10 -3
  70. package/lib/asset/AssetGenerator.js +2 -1
  71. package/lib/asset/AssetParser.js +11 -6
  72. package/lib/asset/AssetSourceParser.js +8 -3
  73. package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -0
  74. package/lib/buildChunkGraph.js +37 -21
  75. package/lib/cache/IdleFileCachePlugin.js +2 -1
  76. package/lib/cache/PackFileCacheStrategy.js +53 -22
  77. package/lib/config/browserslistTargetHandler.js +7 -7
  78. package/lib/config/defaults.js +43 -26
  79. package/lib/container/RemoteRuntimeModule.js +1 -1
  80. package/lib/css/CssExportsGenerator.js +9 -0
  81. package/lib/css/CssGenerator.js +1 -1
  82. package/lib/css/CssLoadingRuntimeModule.js +43 -19
  83. package/lib/css/CssModulesPlugin.js +42 -14
  84. package/lib/css/CssParser.js +22 -0
  85. package/lib/dependencies/AMDDefineDependency.js +34 -4
  86. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +5 -0
  87. package/lib/dependencies/AMDRuntimeModules.js +2 -2
  88. package/lib/dependencies/CommonJsExportsParserPlugin.js +14 -4
  89. package/lib/dependencies/CommonJsImportsParserPlugin.js +169 -59
  90. package/lib/dependencies/CommonJsPlugin.js +13 -8
  91. package/lib/dependencies/CommonJsRequireContextDependency.js +2 -2
  92. package/lib/dependencies/ConstDependency.js +2 -2
  93. package/lib/dependencies/ContextDependency.js +7 -2
  94. package/lib/dependencies/CssImportDependency.js +1 -1
  95. package/lib/dependencies/CssLocalIdentifierDependency.js +5 -0
  96. package/lib/dependencies/CssUrlDependency.js +3 -3
  97. package/lib/dependencies/DllEntryDependency.js +5 -0
  98. package/lib/dependencies/DynamicExports.js +10 -6
  99. package/lib/dependencies/ExportsInfoDependency.js +14 -4
  100. package/lib/dependencies/HarmonyCompatibilityDependency.js +2 -1
  101. package/lib/dependencies/HarmonyDetectionParserPlugin.js +3 -1
  102. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +12 -5
  103. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +2 -0
  104. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +4 -4
  105. package/lib/dependencies/HarmonyExports.js +9 -5
  106. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +40 -27
  107. package/lib/dependencies/HarmonyImportSideEffectDependency.js +1 -2
  108. package/lib/dependencies/HarmonyImportSpecifierDependency.js +31 -21
  109. package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +15 -3
  110. package/lib/dependencies/ImportDependency.js +5 -3
  111. package/lib/dependencies/ImportEagerDependency.js +5 -3
  112. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +19 -0
  113. package/lib/dependencies/ImportMetaPlugin.js +31 -15
  114. package/lib/dependencies/ImportParserPlugin.js +62 -25
  115. package/lib/dependencies/ImportWeakDependency.js +5 -3
  116. package/lib/dependencies/JsonExportsDependency.js +1 -1
  117. package/lib/dependencies/ModuleDependency.js +1 -1
  118. package/lib/dependencies/ModuleDependencyTemplateAsId.js +2 -1
  119. package/lib/dependencies/ProvidedDependency.js +4 -1
  120. package/lib/dependencies/RequireContextDependencyParserPlugin.js +13 -5
  121. package/lib/dependencies/RequireEnsureDependenciesBlock.js +5 -2
  122. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +6 -1
  123. package/lib/dependencies/RequireHeaderDependency.js +4 -0
  124. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +26 -5
  125. package/lib/dependencies/RequireResolveHeaderDependency.js +9 -0
  126. package/lib/dependencies/SystemPlugin.js +17 -5
  127. package/lib/dependencies/SystemRuntimeModule.js +1 -1
  128. package/lib/dependencies/URLDependency.js +2 -2
  129. package/lib/dependencies/URLPlugin.js +9 -4
  130. package/lib/dependencies/WebAssemblyImportDependency.js +1 -1
  131. package/lib/dependencies/WorkerPlugin.js +59 -22
  132. package/lib/esm/ExportWebpackRequireRuntimeModule.js +1 -1
  133. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +1 -1
  134. package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -1
  135. package/lib/ids/HashedModuleIdsPlugin.js +1 -1
  136. package/lib/ids/SyncModuleIdsPlugin.js +1 -0
  137. package/lib/javascript/BasicEvaluatedExpression.js +28 -19
  138. package/lib/javascript/CommonJsChunkFormatPlugin.js +6 -2
  139. package/lib/javascript/JavascriptModulesPlugin.js +25 -5
  140. package/lib/javascript/JavascriptParser.js +157 -85
  141. package/lib/javascript/JavascriptParserHelpers.js +37 -15
  142. package/lib/json/JsonData.js +2 -2
  143. package/lib/json/JsonParser.js +25 -12
  144. package/lib/library/AmdLibraryPlugin.js +2 -2
  145. package/lib/library/AssignLibraryPlugin.js +13 -1
  146. package/lib/library/EnableLibraryPlugin.js +4 -0
  147. package/lib/library/SystemLibraryPlugin.js +1 -1
  148. package/lib/library/UmdLibraryPlugin.js +20 -2
  149. package/lib/logging/runtime.js +1 -1
  150. package/lib/logging/truncateArgs.js +4 -0
  151. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +10 -6
  152. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +2 -1
  153. package/lib/node/RequireChunkLoadingRuntimeModule.js +10 -6
  154. package/lib/optimize/AggressiveMergingPlugin.js +8 -0
  155. package/lib/optimize/AggressiveSplittingPlugin.js +9 -2
  156. package/lib/optimize/EnsureChunkConditionsPlugin.js +3 -0
  157. package/lib/optimize/FlagIncludedChunksPlugin.js +11 -5
  158. package/lib/optimize/InnerGraph.js +5 -5
  159. package/lib/optimize/InnerGraphPlugin.js +2 -1
  160. package/lib/optimize/LimitChunkCountPlugin.js +29 -4
  161. package/lib/optimize/MangleExportsPlugin.js +1 -1
  162. package/lib/optimize/MinMaxSizeWarning.js +5 -0
  163. package/lib/optimize/ModuleConcatenationPlugin.js +59 -2
  164. package/lib/optimize/RealContentHashPlugin.js +80 -30
  165. package/lib/optimize/RemoveParentModulesPlugin.js +6 -0
  166. package/lib/optimize/RuntimeChunkPlugin.js +9 -1
  167. package/lib/optimize/SideEffectsFlagPlugin.js +10 -1
  168. package/lib/optimize/SplitChunksPlugin.js +71 -31
  169. package/lib/performance/SizeLimitsPlugin.js +7 -4
  170. package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +4 -2
  171. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +3 -1
  172. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +6 -3
  173. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +4 -2
  174. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +4 -2
  175. package/lib/rules/BasicEffectRulePlugin.js +4 -0
  176. package/lib/rules/BasicMatcherRulePlugin.js +5 -0
  177. package/lib/rules/RuleSetCompiler.js +3 -3
  178. package/lib/rules/UseEffectRulePlugin.js +6 -4
  179. package/lib/runtime/AsyncModuleRuntimeModule.js +8 -5
  180. package/lib/runtime/AutoPublicPathRuntimeModule.js +4 -2
  181. package/lib/runtime/BaseUriRuntimeModule.js +3 -3
  182. package/lib/runtime/ChunkNameRuntimeModule.js +1 -1
  183. package/lib/runtime/CompatGetDefaultExportRuntimeModule.js +5 -2
  184. package/lib/runtime/CompatRuntimeModule.js +7 -2
  185. package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +5 -2
  186. package/lib/runtime/CreateScriptRuntimeModule.js +4 -2
  187. package/lib/runtime/CreateScriptUrlRuntimeModule.js +4 -2
  188. package/lib/runtime/DefinePropertyGettersRuntimeModule.js +5 -2
  189. package/lib/runtime/EnsureChunkRuntimeModule.js +15 -4
  190. package/lib/runtime/GetChunkFilenameRuntimeModule.js +6 -10
  191. package/lib/runtime/GetFullHashRuntimeModule.js +4 -3
  192. package/lib/runtime/GetMainFilenameRuntimeModule.js +5 -2
  193. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +4 -2
  194. package/lib/runtime/GlobalRuntimeModule.js +1 -1
  195. package/lib/runtime/HasOwnPropertyRuntimeModule.js +5 -2
  196. package/lib/runtime/LoadScriptRuntimeModule.js +64 -48
  197. package/lib/runtime/MakeNamespaceObjectRuntimeModule.js +5 -2
  198. package/lib/runtime/NonceRuntimeModule.js +1 -1
  199. package/lib/runtime/OnChunksLoadedRuntimeModule.js +4 -2
  200. package/lib/runtime/PublicPathRuntimeModule.js +4 -2
  201. package/lib/runtime/RelativeUrlRuntimeModule.js +5 -2
  202. package/lib/runtime/RuntimeIdRuntimeModule.js +6 -2
  203. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +9 -3
  204. package/lib/runtime/StartupEntrypointRuntimeModule.js +3 -2
  205. package/lib/runtime/SystemContextRuntimeModule.js +1 -1
  206. package/lib/serialization/BinaryMiddleware.js +143 -1
  207. package/lib/serialization/ErrorObjectSerializer.js +3 -0
  208. package/lib/serialization/ObjectMiddleware.js +9 -3
  209. package/lib/serialization/types.js +1 -1
  210. package/lib/sharing/ConsumeSharedFallbackDependency.js +3 -0
  211. package/lib/sharing/ConsumeSharedRuntimeModule.js +14 -5
  212. package/lib/sharing/ProvideSharedDependency.js +11 -0
  213. package/lib/sharing/ProvideSharedModule.js +4 -0
  214. package/lib/sharing/ProvideSharedPlugin.js +22 -21
  215. package/lib/sharing/ShareRuntimeModule.js +12 -5
  216. package/lib/sharing/resolveMatchedConfigs.js +1 -1
  217. package/lib/sharing/utils.js +32 -5
  218. package/lib/util/AsyncQueue.js +4 -2
  219. package/lib/util/ParallelismFactorCalculator.js +10 -0
  220. package/lib/util/Semaphore.js +1 -1
  221. package/lib/util/StackedCacheMap.js +1 -1
  222. package/lib/util/URLAbsoluteSpecifier.js +1 -1
  223. package/lib/util/createHash.js +30 -9
  224. package/lib/util/deprecation.js +10 -3
  225. package/lib/util/deterministicGrouping.js +50 -11
  226. package/lib/util/findGraphRoots.js +4 -2
  227. package/lib/util/memoize.js +3 -3
  228. package/lib/util/processAsyncTree.js +7 -1
  229. package/lib/util/registerExternalSerializer.js +1 -1
  230. package/lib/util/runtime.js +84 -21
  231. package/lib/util/semver.js +1 -0
  232. package/lib/util/smartGrouping.js +1 -1
  233. package/lib/validateSchema.js +6 -2
  234. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +6 -2
  235. package/lib/wasm-async/AsyncWebAssemblyParser.js +7 -3
  236. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +14 -7
  237. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +3 -1
  238. package/lib/wasm-sync/WebAssemblyGenerator.js +1 -0
  239. package/lib/wasm-sync/WebAssemblyParser.js +6 -2
  240. package/lib/web/JsonpChunkLoadingRuntimeModule.js +14 -4
  241. package/lib/webpack.js +11 -2
  242. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +15 -16
  243. package/module.d.ts +1 -0
  244. package/package.json +5 -4
  245. package/schemas/WebpackOptions.check.js +1 -1
  246. package/schemas/WebpackOptions.json +52 -6
  247. package/schemas/plugins/css/CssGeneratorOptions.json +1 -1
  248. package/schemas/plugins/css/CssParserOptions.json +1 -1
  249. package/types.d.ts +606 -292
@@ -12,6 +12,8 @@ const ImportDependency = require("./ImportDependency");
12
12
  /** @typedef {import("../Dependency")} Dependency */
13
13
  /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */
14
14
  /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
15
+ /** @typedef {import("../Module")} Module */
16
+ /** @typedef {import("../Module").BuildMeta} BuildMeta */
15
17
  /** @typedef {import("../ModuleGraph")} ModuleGraph */
16
18
  /** @typedef {import("../javascript/JavascriptParser").Range} Range */
17
19
 
@@ -19,7 +21,7 @@ class ImportEagerDependency extends ImportDependency {
19
21
  /**
20
22
  * @param {string} request the request
21
23
  * @param {Range} range expression range
22
- * @param {string[][]=} referencedExports list of referenced exports
24
+ * @param {(string[][] | null)=} referencedExports list of referenced exports
23
25
  */
24
26
  constructor(request, range, referencedExports) {
25
27
  super(request, range, referencedExports);
@@ -56,9 +58,9 @@ ImportEagerDependency.Template = class ImportEagerDependencyTemplate extends (
56
58
  const dep = /** @type {ImportEagerDependency} */ (dependency);
57
59
  const content = runtimeTemplate.moduleNamespacePromise({
58
60
  chunkGraph,
59
- module: moduleGraph.getModule(dep),
61
+ module: /** @type {Module} */ (moduleGraph.getModule(dep)),
60
62
  request: dep.request,
61
- strict: module.buildMeta.strictHarmonyModule,
63
+ strict: /** @type {BuildMeta} */ (module.buildMeta).strictHarmonyModule,
62
64
  message: "import() eager",
63
65
  runtimeRequirements
64
66
  });
@@ -219,6 +219,25 @@ module.exports = class ImportMetaContextDependencyParserPlugin {
219
219
  }
220
220
  break;
221
221
  }
222
+ case "fetchPriority": {
223
+ const expr = parser.evaluateExpression(
224
+ /** @type {Expression} */ (prop.value)
225
+ );
226
+ if (
227
+ expr.isString() &&
228
+ ["high", "low", "auto"].includes(expr.string)
229
+ ) {
230
+ groupOptions.fetchPriority =
231
+ /** @type {RawChunkGroupOptions["fetchPriority"]} */ (
232
+ expr.string
233
+ );
234
+ } else {
235
+ errors.push(
236
+ createPropertyParseError(prop, '"high"|"low"|"auto"')
237
+ );
238
+ }
239
+ break;
240
+ }
222
241
  case "recursive": {
223
242
  const recursiveExpr = parser.evaluateExpression(
224
243
  /** @type {Expression} */ (prop.value)
@@ -26,8 +26,10 @@ const ConstDependency = require("./ConstDependency");
26
26
  /** @typedef {import("estree").MemberExpression} MemberExpression */
27
27
  /** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */
28
28
  /** @typedef {import("../Compiler")} Compiler */
29
+ /** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
29
30
  /** @typedef {import("../NormalModule")} NormalModule */
30
31
  /** @typedef {import("../javascript/JavascriptParser")} Parser */
32
+ /** @typedef {import("../javascript/JavascriptParser").Range} Range */
31
33
 
32
34
  const getCriticalDependencyWarning = memoize(() =>
33
35
  require("./CriticalDependencyWarning")
@@ -64,10 +66,10 @@ class ImportMetaPlugin {
64
66
  .for("import.meta")
65
67
  .tap(PLUGIN_NAME, metaProperty => {
66
68
  const dep = new ConstDependency(
67
- importMetaName,
68
- metaProperty.range
69
+ /** @type {string} */ (importMetaName),
70
+ /** @type {Range} */ (metaProperty.range)
69
71
  );
70
- dep.loc = metaProperty.loc;
72
+ dep.loc = /** @type {DependencyLocation} */ (metaProperty.loc);
71
73
  parser.state.module.addPresentationalDependency(dep);
72
74
  return true;
73
75
  });
@@ -82,6 +84,10 @@ class ImportMetaPlugin {
82
84
  const importMetaUrl = () =>
83
85
  JSON.stringify(getUrl(parser.state.module));
84
86
  const importMetaWebpackVersion = () => JSON.stringify(webpackVersion);
87
+ /**
88
+ * @param {string[]} members members
89
+ * @returns {string} error message
90
+ */
85
91
  const importMetaUnknownProperty = members =>
86
92
  `${Template.toNormalComment(
87
93
  "unsupported import.meta." + members.join(".")
@@ -106,16 +112,20 @@ class ImportMetaPlugin {
106
112
  new CriticalDependencyWarning(
107
113
  "Accessing import.meta directly is unsupported (only property access or destructuring is supported)"
108
114
  ),
109
- metaProperty.loc
115
+ /** @type {DependencyLocation} */ (metaProperty.loc)
110
116
  )
111
117
  );
112
118
  const dep = new ConstDependency(
113
119
  `${
114
- parser.isAsiPosition(metaProperty.range[0]) ? ";" : ""
120
+ parser.isAsiPosition(
121
+ /** @type {Range} */ (metaProperty.range)[0]
122
+ )
123
+ ? ";"
124
+ : ""
115
125
  }({})`,
116
- metaProperty.range
126
+ /** @type {Range} */ (metaProperty.range)
117
127
  );
118
- dep.loc = metaProperty.loc;
128
+ dep.loc = /** @type {DependencyLocation} */ (metaProperty.loc);
119
129
  parser.state.module.addPresentationalDependency(dep);
120
130
  return true;
121
131
  }
@@ -136,8 +146,11 @@ class ImportMetaPlugin {
136
146
  break;
137
147
  }
138
148
  }
139
- const dep = new ConstDependency(`({${str}})`, metaProperty.range);
140
- dep.loc = metaProperty.loc;
149
+ const dep = new ConstDependency(
150
+ `({${str}})`,
151
+ /** @type {Range} */ (metaProperty.range)
152
+ );
153
+ dep.loc = /** @type {DependencyLocation} */ (metaProperty.loc);
141
154
  parser.state.module.addPresentationalDependency(dep);
142
155
  return true;
143
156
  });
@@ -159,8 +172,11 @@ class ImportMetaPlugin {
159
172
  parser.hooks.expression
160
173
  .for("import.meta.url")
161
174
  .tap(PLUGIN_NAME, expr => {
162
- const dep = new ConstDependency(importMetaUrl(), expr.range);
163
- dep.loc = expr.loc;
175
+ const dep = new ConstDependency(
176
+ importMetaUrl(),
177
+ /** @type {Range} */ (expr.range)
178
+ );
179
+ dep.loc = /** @type {DependencyLocation} */ (expr.loc);
164
180
  parser.state.module.addPresentationalDependency(dep);
165
181
  return true;
166
182
  });
@@ -172,7 +188,7 @@ class ImportMetaPlugin {
172
188
  .tap(PLUGIN_NAME, expr => {
173
189
  return new BasicEvaluatedExpression()
174
190
  .setString(getUrl(parser.state.module))
175
- .setRange(expr.range);
191
+ .setRange(/** @type {Range} */ (expr.range));
176
192
  });
177
193
 
178
194
  /// import.meta.webpack ///
@@ -201,9 +217,9 @@ class ImportMetaPlugin {
201
217
  .tap(PLUGIN_NAME, (expr, members) => {
202
218
  const dep = new ConstDependency(
203
219
  importMetaUnknownProperty(members),
204
- expr.range
220
+ /** @type {Range} */ (expr.range)
205
221
  );
206
- dep.loc = expr.loc;
222
+ dep.loc = /** @type {DependencyLocation} */ (expr.loc);
207
223
  parser.state.module.addPresentationalDependency(dep);
208
224
  return true;
209
225
  });
@@ -220,7 +236,7 @@ class ImportMetaPlugin {
220
236
  ) {
221
237
  return new BasicEvaluatedExpression()
222
238
  .setUndefined()
223
- .setRange(expr.range);
239
+ .setRange(/** @type {Range} */ (expr.range));
224
240
  }
225
241
  });
226
242
  };
@@ -17,7 +17,10 @@ const ImportWeakDependency = require("./ImportWeakDependency");
17
17
  /** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */
18
18
  /** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */
19
19
  /** @typedef {import("../ContextModule").ContextMode} ContextMode */
20
+ /** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
21
+ /** @typedef {import("../Module").BuildMeta} BuildMeta */
20
22
  /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */
23
+ /** @typedef {import("../javascript/JavascriptParser").Range} Range */
21
24
 
22
25
  class ImportParserPlugin {
23
26
  /**
@@ -32,14 +35,18 @@ class ImportParserPlugin {
32
35
  * @returns {void}
33
36
  */
34
37
  apply(parser) {
38
+ /**
39
+ * @template T
40
+ * @param {Iterable<T>} enumerable enumerable
41
+ * @returns {T[][]} array of array
42
+ */
35
43
  const exportsFromEnumerable = enumerable =>
36
44
  Array.from(enumerable, e => [e]);
37
45
  parser.hooks.importCall.tap("ImportParserPlugin", expr => {
38
46
  const param = parser.evaluateExpression(expr.source);
39
47
 
40
48
  let chunkName = null;
41
- /** @type {ContextMode} */
42
- let mode = this.options.dynamicImportMode;
49
+ let mode = /** @type {ContextMode} */ (this.options.dynamicImportMode);
43
50
  let include = null;
44
51
  let exclude = null;
45
52
  /** @type {string[][] | null} */
@@ -47,7 +54,11 @@ class ImportParserPlugin {
47
54
  /** @type {RawChunkGroupOptions} */
48
55
  const groupOptions = {};
49
56
 
50
- const { dynamicImportPreload, dynamicImportPrefetch } = this.options;
57
+ const {
58
+ dynamicImportPreload,
59
+ dynamicImportPrefetch,
60
+ dynamicImportFetchPriority
61
+ } = this.options;
51
62
  if (dynamicImportPreload !== undefined && dynamicImportPreload !== false)
52
63
  groupOptions.preloadOrder =
53
64
  dynamicImportPreload === true ? 0 : dynamicImportPreload;
@@ -57,9 +68,14 @@ class ImportParserPlugin {
57
68
  )
58
69
  groupOptions.prefetchOrder =
59
70
  dynamicImportPrefetch === true ? 0 : dynamicImportPrefetch;
71
+ if (
72
+ dynamicImportFetchPriority !== undefined &&
73
+ dynamicImportFetchPriority !== false
74
+ )
75
+ groupOptions.fetchPriority = dynamicImportFetchPriority;
60
76
 
61
77
  const { options: importOptions, errors: commentErrors } =
62
- parser.parseCommentOptions(expr.range);
78
+ parser.parseCommentOptions(/** @type {Range} */ (expr.range));
63
79
 
64
80
  if (commentErrors) {
65
81
  for (const e of commentErrors) {
@@ -79,7 +95,7 @@ class ImportParserPlugin {
79
95
  parser.state.module.addWarning(
80
96
  new UnsupportedFeatureWarning(
81
97
  `\`webpackIgnore\` expected a boolean, but received: ${importOptions.webpackIgnore}.`,
82
- expr.loc
98
+ /** @type {DependencyLocation} */ (expr.loc)
83
99
  )
84
100
  );
85
101
  } else {
@@ -94,7 +110,7 @@ class ImportParserPlugin {
94
110
  parser.state.module.addWarning(
95
111
  new UnsupportedFeatureWarning(
96
112
  `\`webpackChunkName\` expected a string, but received: ${importOptions.webpackChunkName}.`,
97
- expr.loc
113
+ /** @type {DependencyLocation} */ (expr.loc)
98
114
  )
99
115
  );
100
116
  } else {
@@ -106,7 +122,7 @@ class ImportParserPlugin {
106
122
  parser.state.module.addWarning(
107
123
  new UnsupportedFeatureWarning(
108
124
  `\`webpackMode\` expected a string, but received: ${importOptions.webpackMode}.`,
109
- expr.loc
125
+ /** @type {DependencyLocation} */ (expr.loc)
110
126
  )
111
127
  );
112
128
  } else {
@@ -122,7 +138,7 @@ class ImportParserPlugin {
122
138
  parser.state.module.addWarning(
123
139
  new UnsupportedFeatureWarning(
124
140
  `\`webpackPrefetch\` expected true or a number, but received: ${importOptions.webpackPrefetch}.`,
125
- expr.loc
141
+ /** @type {DependencyLocation} */ (expr.loc)
126
142
  )
127
143
  );
128
144
  }
@@ -136,7 +152,22 @@ class ImportParserPlugin {
136
152
  parser.state.module.addWarning(
137
153
  new UnsupportedFeatureWarning(
138
154
  `\`webpackPreload\` expected true or a number, but received: ${importOptions.webpackPreload}.`,
139
- expr.loc
155
+ /** @type {DependencyLocation} */ (expr.loc)
156
+ )
157
+ );
158
+ }
159
+ }
160
+ if (importOptions.webpackFetchPriority !== undefined) {
161
+ if (
162
+ typeof importOptions.webpackFetchPriority === "string" &&
163
+ ["high", "low", "auto"].includes(importOptions.webpackFetchPriority)
164
+ ) {
165
+ groupOptions.fetchPriority = importOptions.webpackFetchPriority;
166
+ } else {
167
+ parser.state.module.addWarning(
168
+ new UnsupportedFeatureWarning(
169
+ `\`webpackFetchPriority\` expected true or "low", "high" or "auto", but received: ${importOptions.webpackFetchPriority}.`,
170
+ /** @type {DependencyLocation} */ (expr.loc)
140
171
  )
141
172
  );
142
173
  }
@@ -149,7 +180,7 @@ class ImportParserPlugin {
149
180
  parser.state.module.addWarning(
150
181
  new UnsupportedFeatureWarning(
151
182
  `\`webpackInclude\` expected a regular expression, but received: ${importOptions.webpackInclude}.`,
152
- expr.loc
183
+ /** @type {DependencyLocation} */ (expr.loc)
153
184
  )
154
185
  );
155
186
  } else {
@@ -164,7 +195,7 @@ class ImportParserPlugin {
164
195
  parser.state.module.addWarning(
165
196
  new UnsupportedFeatureWarning(
166
197
  `\`webpackExclude\` expected a regular expression, but received: ${importOptions.webpackExclude}.`,
167
- expr.loc
198
+ /** @type {DependencyLocation} */ (expr.loc)
168
199
  )
169
200
  );
170
201
  } else {
@@ -176,7 +207,7 @@ class ImportParserPlugin {
176
207
  !(
177
208
  typeof importOptions.webpackExports === "string" ||
178
209
  (Array.isArray(importOptions.webpackExports) &&
179
- importOptions.webpackExports.every(
210
+ /** @type {string[]} */ (importOptions.webpackExports).every(
180
211
  item => typeof item === "string"
181
212
  ))
182
213
  )
@@ -184,7 +215,7 @@ class ImportParserPlugin {
184
215
  parser.state.module.addWarning(
185
216
  new UnsupportedFeatureWarning(
186
217
  `\`webpackExports\` expected a string or an array of strings, but received: ${importOptions.webpackExports}.`,
187
- expr.loc
218
+ /** @type {DependencyLocation} */ (expr.loc)
188
219
  )
189
220
  );
190
221
  } else {
@@ -206,7 +237,7 @@ class ImportParserPlugin {
206
237
  parser.state.module.addWarning(
207
238
  new UnsupportedFeatureWarning(
208
239
  `\`webpackMode\` expected 'lazy', 'lazy-once', 'eager' or 'weak', but received: ${mode}.`,
209
- expr.loc
240
+ /** @type {DependencyLocation} */ (expr.loc)
210
241
  )
211
242
  );
212
243
  mode = "lazy";
@@ -219,7 +250,7 @@ class ImportParserPlugin {
219
250
  parser.state.module.addWarning(
220
251
  new UnsupportedFeatureWarning(
221
252
  `\`webpackExports\` could not be used with destructuring assignment.`,
222
- expr.loc
253
+ /** @type {DependencyLocation} */ (expr.loc)
223
254
  )
224
255
  );
225
256
  }
@@ -229,15 +260,15 @@ class ImportParserPlugin {
229
260
  if (param.isString()) {
230
261
  if (mode === "eager") {
231
262
  const dep = new ImportEagerDependency(
232
- param.string,
233
- expr.range,
263
+ /** @type {string} */ (param.string),
264
+ /** @type {Range} */ (expr.range),
234
265
  exports
235
266
  );
236
267
  parser.state.current.addDependency(dep);
237
268
  } else if (mode === "weak") {
238
269
  const dep = new ImportWeakDependency(
239
- param.string,
240
- expr.range,
270
+ /** @type {string} */ (param.string),
271
+ /** @type {Range} */ (expr.range),
241
272
  exports
242
273
  );
243
274
  parser.state.current.addDependency(dep);
@@ -247,11 +278,15 @@ class ImportParserPlugin {
247
278
  ...groupOptions,
248
279
  name: chunkName
249
280
  },
250
- expr.loc,
281
+ /** @type {DependencyLocation} */ (expr.loc),
251
282
  param.string
252
283
  );
253
- const dep = new ImportDependency(param.string, expr.range, exports);
254
- dep.loc = expr.loc;
284
+ const dep = new ImportDependency(
285
+ /** @type {string} */ (param.string),
286
+ /** @type {Range} */ (expr.range),
287
+ exports
288
+ );
289
+ dep.loc = /** @type {DependencyLocation} */ (expr.loc);
255
290
  depBlock.addDependency(dep);
256
291
  parser.state.current.addBlock(depBlock);
257
292
  }
@@ -262,7 +297,7 @@ class ImportParserPlugin {
262
297
  }
263
298
  const dep = ContextDependencyHelpers.create(
264
299
  ImportContextDependency,
265
- expr.range,
300
+ /** @type {Range} */ (expr.range),
266
301
  param,
267
302
  expr,
268
303
  this.options,
@@ -272,7 +307,9 @@ class ImportParserPlugin {
272
307
  include,
273
308
  exclude,
274
309
  mode,
275
- namespaceObject: parser.state.module.buildMeta.strictHarmonyModule
310
+ namespaceObject: /** @type {BuildMeta} */ (
311
+ parser.state.module.buildMeta
312
+ ).strictHarmonyModule
276
313
  ? "strict"
277
314
  : true,
278
315
  typePrefix: "import()",
@@ -282,7 +319,7 @@ class ImportParserPlugin {
282
319
  parser
283
320
  );
284
321
  if (!dep) return;
285
- dep.loc = expr.loc;
322
+ dep.loc = /** @type {DependencyLocation} */ (expr.loc);
286
323
  dep.optional = !!parser.scope.inTry;
287
324
  parser.state.current.addDependency(dep);
288
325
  return true;
@@ -12,6 +12,8 @@ const ImportDependency = require("./ImportDependency");
12
12
  /** @typedef {import("../Dependency")} Dependency */
13
13
  /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */
14
14
  /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
15
+ /** @typedef {import("../Module")} Module */
16
+ /** @typedef {import("../Module").BuildMeta} BuildMeta */
15
17
  /** @typedef {import("../ModuleGraph")} ModuleGraph */
16
18
  /** @typedef {import("../javascript/JavascriptParser").Range} Range */
17
19
 
@@ -19,7 +21,7 @@ class ImportWeakDependency extends ImportDependency {
19
21
  /**
20
22
  * @param {string} request the request
21
23
  * @param {Range} range expression range
22
- * @param {string[][]=} referencedExports list of referenced exports
24
+ * @param {(string[][] | null)=} referencedExports list of referenced exports
23
25
  */
24
26
  constructor(request, range, referencedExports) {
25
27
  super(request, range, referencedExports);
@@ -53,9 +55,9 @@ ImportWeakDependency.Template = class ImportDependencyTemplate extends (
53
55
  const dep = /** @type {ImportWeakDependency} */ (dependency);
54
56
  const content = runtimeTemplate.moduleNamespacePromise({
55
57
  chunkGraph,
56
- module: moduleGraph.getModule(dep),
58
+ module: /** @type {Module} */ (moduleGraph.getModule(dep)),
57
59
  request: dep.request,
58
- strict: module.buildMeta.strictHarmonyModule,
60
+ strict: /** @type {BuildMeta} */ (module.buildMeta).strictHarmonyModule,
59
61
  message: "import() weak",
60
62
  weak: true,
61
63
  runtimeRequirements
@@ -47,7 +47,7 @@ const getExportsFromData = data => {
47
47
 
48
48
  class JsonExportsDependency extends NullDependency {
49
49
  /**
50
- * @param {JsonData=} data json data
50
+ * @param {JsonData} data json data
51
51
  */
52
52
  constructor(data) {
53
53
  super();
@@ -58,7 +58,7 @@ class ModuleDependency extends Dependency {
58
58
 
59
59
  /**
60
60
  * @param {string} context context directory
61
- * @returns {Module} a module
61
+ * @returns {Module | null} a module
62
62
  */
63
63
  createIgnoredModule(context) {
64
64
  const RawModule = getRawModule();
@@ -10,6 +10,7 @@ const ModuleDependency = require("./ModuleDependency");
10
10
  /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
11
11
  /** @typedef {import("../Dependency")} Dependency */
12
12
  /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
13
+ /** @typedef {import("../Module")} Module */
13
14
 
14
15
  class ModuleDependencyTemplateAsId extends ModuleDependency.Template {
15
16
  /**
@@ -22,7 +23,7 @@ class ModuleDependencyTemplateAsId extends ModuleDependency.Template {
22
23
  const dep = /** @type {ModuleDependency} */ (dependency);
23
24
  if (!dep.range) return;
24
25
  const content = runtimeTemplate.moduleId({
25
- module: moduleGraph.getModule(dep),
26
+ module: /** @type {Module} */ (moduleGraph.getModule(dep)),
26
27
  chunkGraph,
27
28
  request: dep.request,
28
29
  weak: dep.weak
@@ -17,6 +17,7 @@ const ModuleDependency = require("./ModuleDependency");
17
17
  /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
18
18
  /** @typedef {import("../DependencyTemplates")} DependencyTemplates */
19
19
  /** @typedef {import("../ModuleGraph")} ModuleGraph */
20
+ /** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */
20
21
  /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
21
22
  /** @typedef {import("../javascript/JavascriptParser").Range} Range */
22
23
  /** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
@@ -127,7 +128,9 @@ class ProvidedDependencyTemplate extends ModuleDependency.Template {
127
128
  }
128
129
  ) {
129
130
  const dep = /** @type {ProvidedDependency} */ (dependency);
130
- const connection = moduleGraph.getConnection(dep);
131
+ const connection =
132
+ /** @type {ModuleGraphConnection} */
133
+ (moduleGraph.getConnection(dep));
131
134
  const exportsInfo = moduleGraph.getExportsInfo(connection.module);
132
135
  const usedName = exportsInfo.getUsedName(dep.ids, runtime);
133
136
  initFragments.push(
@@ -7,7 +7,15 @@
7
7
 
8
8
  const RequireContextDependency = require("./RequireContextDependency");
9
9
 
10
+ /** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
11
+ /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */
12
+ /** @typedef {import("../javascript/JavascriptParser").Range} Range */
13
+
10
14
  module.exports = class RequireContextDependencyParserPlugin {
15
+ /**
16
+ * @param {JavascriptParser} parser the parser
17
+ * @returns {void}
18
+ */
11
19
  apply(parser) {
12
20
  parser.hooks.call
13
21
  .for("require.context")
@@ -19,19 +27,19 @@ module.exports = class RequireContextDependencyParserPlugin {
19
27
  case 4: {
20
28
  const modeExpr = parser.evaluateExpression(expr.arguments[3]);
21
29
  if (!modeExpr.isString()) return;
22
- mode = modeExpr.string;
30
+ mode = /** @type {string} */ (modeExpr.string);
23
31
  }
24
32
  // falls through
25
33
  case 3: {
26
34
  const regExpExpr = parser.evaluateExpression(expr.arguments[2]);
27
35
  if (!regExpExpr.isRegExp()) return;
28
- regExp = regExpExpr.regExp;
36
+ regExp = /** @type {RegExp} */ (regExpExpr.regExp);
29
37
  }
30
38
  // falls through
31
39
  case 2: {
32
40
  const recursiveExpr = parser.evaluateExpression(expr.arguments[1]);
33
41
  if (!recursiveExpr.isBoolean()) return;
34
- recursive = recursiveExpr.bool;
42
+ recursive = /** @type {boolean} */ (recursiveExpr.bool);
35
43
  }
36
44
  // falls through
37
45
  case 1: {
@@ -45,9 +53,9 @@ module.exports = class RequireContextDependencyParserPlugin {
45
53
  mode,
46
54
  category: "commonjs"
47
55
  },
48
- expr.range
56
+ /** @type {Range} */ (expr.range)
49
57
  );
50
- dep.loc = expr.loc;
58
+ dep.loc = /** @type {DependencyLocation} */ (expr.loc);
51
59
  dep.optional = !!parser.scope.inTry;
52
60
  parser.state.current.addDependency(dep);
53
61
  return true;
@@ -8,10 +8,13 @@
8
8
  const AsyncDependenciesBlock = require("../AsyncDependenciesBlock");
9
9
  const makeSerializable = require("../util/makeSerializable");
10
10
 
11
+ /** @typedef {import("../ChunkGroup").ChunkGroupOptions} ChunkGroupOptions */
12
+ /** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
13
+
11
14
  class RequireEnsureDependenciesBlock extends AsyncDependenciesBlock {
12
15
  /**
13
- * @param {TODO} chunkName chunk name
14
- * @param {TODO} loc location info
16
+ * @param {ChunkGroupOptions & { entryOptions?: TODO }} chunkName chunk name
17
+ * @param {DependencyLocation} loc location info
15
18
  */
16
19
  constructor(chunkName, loc) {
17
20
  super(chunkName, loc, null);
@@ -10,6 +10,9 @@ const RequireEnsureDependency = require("./RequireEnsureDependency");
10
10
  const RequireEnsureItemDependency = require("./RequireEnsureItemDependency");
11
11
  const getFunctionExpression = require("./getFunctionExpression");
12
12
 
13
+ /** @typedef {import("../ChunkGroup").ChunkGroupOptions} ChunkGroupOptions */
14
+ /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */
15
+
13
16
  module.exports = class RequireEnsureDependenciesBlockParserPlugin {
14
17
  apply(parser) {
15
18
  parser.hooks.call
@@ -57,7 +60,9 @@ module.exports = class RequireEnsureDependenciesBlockParserPlugin {
57
60
  }
58
61
 
59
62
  const depBlock = new RequireEnsureDependenciesBlock(
60
- chunkName,
63
+ /** @type {ChunkGroupOptions & { entryOptions?: TODO }} */ (
64
+ chunkName
65
+ ),
61
66
  expr.loc
62
67
  );
63
68
  const errorCallbackExists =
@@ -35,6 +35,10 @@ class RequireHeaderDependency extends NullDependency {
35
35
  super.serialize(context);
36
36
  }
37
37
 
38
+ /**
39
+ * @param {ObjectDeserializerContext} context context
40
+ * @returns {RequireHeaderDependency} RequireHeaderDependency
41
+ */
38
42
  static deserialize(context) {
39
43
  const obj = new RequireHeaderDependency(context.read());
40
44
  obj.deserialize(context);
@@ -13,6 +13,10 @@ const {
13
13
  const makeSerializable = require("../util/makeSerializable");
14
14
  const RequireIncludeDependency = require("./RequireIncludeDependency");
15
15
 
16
+ /** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
17
+ /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */
18
+ /** @typedef {import("../javascript/JavascriptParser").Range} Range */
19
+
16
20
  module.exports = class RequireIncludeDependencyParserPlugin {
17
21
  /**
18
22
  * @param {boolean} warn true: warn about deprecation, false: don't warn
@@ -20,6 +24,11 @@ module.exports = class RequireIncludeDependencyParserPlugin {
20
24
  constructor(warn) {
21
25
  this.warn = warn;
22
26
  }
27
+
28
+ /**
29
+ * @param {JavascriptParser} parser the parser
30
+ * @returns {void}
31
+ */
23
32
  apply(parser) {
24
33
  const { warn } = this;
25
34
  parser.hooks.call
@@ -31,12 +40,17 @@ module.exports = class RequireIncludeDependencyParserPlugin {
31
40
 
32
41
  if (warn) {
33
42
  parser.state.module.addWarning(
34
- new RequireIncludeDeprecationWarning(expr.loc)
43
+ new RequireIncludeDeprecationWarning(
44
+ /** @type {DependencyLocation} */ (expr.loc)
45
+ )
35
46
  );
36
47
  }
37
48
 
38
- const dep = new RequireIncludeDependency(param.string, expr.range);
39
- dep.loc = expr.loc;
49
+ const dep = new RequireIncludeDependency(
50
+ /** @type {string} */ (param.string),
51
+ /** @type {Range} */ (expr.range)
52
+ );
53
+ dep.loc = /** @type {DependencyLocation} */ (expr.loc);
40
54
  parser.state.current.addDependency(dep);
41
55
  return true;
42
56
  });
@@ -45,7 +59,9 @@ module.exports = class RequireIncludeDependencyParserPlugin {
45
59
  .tap("RequireIncludePlugin", expr => {
46
60
  if (warn) {
47
61
  parser.state.module.addWarning(
48
- new RequireIncludeDeprecationWarning(expr.loc)
62
+ new RequireIncludeDeprecationWarning(
63
+ /** @type {DependencyLocation} */ (expr.loc)
64
+ )
49
65
  );
50
66
  }
51
67
  return evaluateToString("function")(expr);
@@ -55,7 +71,9 @@ module.exports = class RequireIncludeDependencyParserPlugin {
55
71
  .tap("RequireIncludePlugin", expr => {
56
72
  if (warn) {
57
73
  parser.state.module.addWarning(
58
- new RequireIncludeDeprecationWarning(expr.loc)
74
+ new RequireIncludeDeprecationWarning(
75
+ /** @type {DependencyLocation} */ (expr.loc)
76
+ )
59
77
  );
60
78
  }
61
79
  return toConstantDependency(parser, JSON.stringify("function"))(expr);
@@ -64,6 +82,9 @@ module.exports = class RequireIncludeDependencyParserPlugin {
64
82
  };
65
83
 
66
84
  class RequireIncludeDeprecationWarning extends WebpackError {
85
+ /**
86
+ * @param {DependencyLocation} loc location
87
+ */
67
88
  constructor(loc) {
68
89
  super("require.include() is deprecated and will be removed soon.");
69
90