webpack 5.99.9 → 5.100.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 (308) hide show
  1. package/bin/webpack.js +8 -2
  2. package/hot/log.js +15 -15
  3. package/hot/poll.js +1 -0
  4. package/lib/APIPlugin.js +3 -3
  5. package/lib/AbstractMethodError.js +1 -0
  6. package/lib/AutomaticPrefetchPlugin.js +1 -0
  7. package/lib/BannerPlugin.js +1 -1
  8. package/lib/CaseSensitiveModulesWarning.js +4 -4
  9. package/lib/Chunk.js +6 -6
  10. package/lib/ChunkGraph.js +37 -31
  11. package/lib/ChunkGroup.js +4 -4
  12. package/lib/ChunkTemplate.js +1 -1
  13. package/lib/CleanPlugin.js +94 -17
  14. package/lib/CodeGenerationResults.js +1 -1
  15. package/lib/CompatibilityPlugin.js +5 -2
  16. package/lib/Compilation.js +67 -45
  17. package/lib/Compiler.js +46 -16
  18. package/lib/ConcatenationScope.js +15 -6
  19. package/lib/ConstPlugin.js +5 -3
  20. package/lib/ContextModule.js +16 -12
  21. package/lib/ContextModuleFactory.js +4 -3
  22. package/lib/ContextReplacementPlugin.js +4 -2
  23. package/lib/CssModule.js +2 -2
  24. package/lib/DefinePlugin.js +111 -3
  25. package/lib/DelegatedModuleFactoryPlugin.js +18 -18
  26. package/lib/Dependency.js +11 -4
  27. package/lib/DependencyTemplate.js +1 -0
  28. package/lib/DllEntryPlugin.js +3 -1
  29. package/lib/DllPlugin.js +4 -3
  30. package/lib/DllReferencePlugin.js +2 -2
  31. package/lib/DynamicEntryPlugin.js +1 -1
  32. package/lib/EntryOptionPlugin.js +5 -0
  33. package/lib/ErrorHelpers.js +4 -4
  34. package/lib/EvalDevToolModulePlugin.js +3 -3
  35. package/lib/EvalSourceMapDevToolPlugin.js +7 -7
  36. package/lib/ExportsInfo.js +48 -39
  37. package/lib/ExternalModule.js +15 -11
  38. package/lib/ExternalModuleFactoryPlugin.js +5 -2
  39. package/lib/FileSystemInfo.js +51 -36
  40. package/lib/FlagDependencyExportsPlugin.js +14 -7
  41. package/lib/FlagDependencyUsagePlugin.js +1 -1
  42. package/lib/Generator.js +14 -1
  43. package/lib/HookWebpackError.js +1 -0
  44. package/lib/HotModuleReplacementPlugin.js +77 -50
  45. package/lib/IgnorePlugin.js +5 -2
  46. package/lib/InvalidDependenciesModuleWarning.js +1 -1
  47. package/lib/JavascriptMetaInfoPlugin.js +0 -1
  48. package/lib/LibManifestPlugin.js +4 -2
  49. package/lib/LoaderOptionsPlugin.js +6 -4
  50. package/lib/MainTemplate.js +2 -2
  51. package/lib/Module.js +21 -6
  52. package/lib/ModuleFactory.js +1 -0
  53. package/lib/ModuleGraph.js +24 -2
  54. package/lib/ModuleGraphConnection.js +5 -5
  55. package/lib/ModuleInfoHeaderPlugin.js +2 -1
  56. package/lib/ModuleParseError.js +1 -0
  57. package/lib/ModuleSourceTypesConstants.js +12 -12
  58. package/lib/ModuleTemplate.js +1 -1
  59. package/lib/ModuleTypeConstants.js +21 -21
  60. package/lib/MultiCompiler.js +6 -6
  61. package/lib/NormalModule.js +31 -44
  62. package/lib/NormalModuleFactory.js +34 -20
  63. package/lib/NormalModuleReplacementPlugin.js +1 -1
  64. package/lib/NullFactory.js +1 -0
  65. package/lib/OptimizationStages.js +1 -1
  66. package/lib/Parser.js +1 -0
  67. package/lib/ProgressPlugin.js +12 -5
  68. package/lib/ProvidePlugin.js +5 -1
  69. package/lib/RawModule.js +14 -0
  70. package/lib/RecordIdsPlugin.js +3 -3
  71. package/lib/RuntimeGlobals.js +175 -155
  72. package/lib/RuntimeModule.js +1 -0
  73. package/lib/RuntimePlugin.js +33 -7
  74. package/lib/RuntimeTemplate.js +111 -11
  75. package/lib/SourceMapDevToolModuleOptionsPlugin.js +15 -25
  76. package/lib/SourceMapDevToolPlugin.js +19 -17
  77. package/lib/Template.js +2 -2
  78. package/lib/TemplatedPathPlugin.js +1 -1
  79. package/lib/WarnDeprecatedOptionPlugin.js +7 -8
  80. package/lib/WatchIgnorePlugin.js +4 -3
  81. package/lib/WebpackIsIncludedPlugin.js +2 -1
  82. package/lib/WebpackOptionsApply.js +115 -27
  83. package/lib/asset/AssetGenerator.js +15 -11
  84. package/lib/asset/AssetModulesPlugin.js +19 -17
  85. package/lib/asset/AssetSourceGenerator.js +4 -4
  86. package/lib/asset/RawDataUrlModule.js +4 -2
  87. package/lib/async-modules/AwaitDependenciesInitFragment.js +1 -1
  88. package/lib/buildChunkGraph.js +6 -3
  89. package/lib/cache/AddBuildDependenciesPlugin.js +5 -6
  90. package/lib/cache/IdleFileCachePlugin.js +7 -4
  91. package/lib/cache/MemoryCachePlugin.js +1 -0
  92. package/lib/cache/MemoryWithGcCachePlugin.js +1 -0
  93. package/lib/cache/PackFileCacheStrategy.js +26 -20
  94. package/lib/cache/ResolverCachePlugin.js +16 -8
  95. package/lib/cli.js +15 -10
  96. package/lib/config/browserslistTargetHandler.js +3 -3
  97. package/lib/config/defaults.js +25 -17
  98. package/lib/config/normalization.js +2 -1
  99. package/lib/config/target.js +6 -5
  100. package/lib/container/ContainerPlugin.js +1 -1
  101. package/lib/container/ContainerReferencePlugin.js +1 -1
  102. package/lib/container/FallbackModule.js +2 -1
  103. package/lib/container/HoistContainerReferencesPlugin.js +1 -1
  104. package/lib/container/ModuleFederationPlugin.js +2 -2
  105. package/lib/container/RemoteModule.js +1 -1
  106. package/lib/css/CssGenerator.js +9 -6
  107. package/lib/css/CssModulesPlugin.js +44 -31
  108. package/lib/css/CssParser.js +6 -4
  109. package/lib/css/walkCssTokens.js +33 -37
  110. package/lib/debug/ProfilingPlugin.js +6 -6
  111. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +8 -8
  112. package/lib/dependencies/AMDPlugin.js +12 -8
  113. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +28 -26
  114. package/lib/dependencies/CachedConstDependency.js +1 -5
  115. package/lib/dependencies/CommonJsExportRequireDependency.js +6 -4
  116. package/lib/dependencies/CommonJsExportsParserPlugin.js +22 -25
  117. package/lib/dependencies/CommonJsFullRequireDependency.js +1 -9
  118. package/lib/dependencies/CommonJsImportsParserPlugin.js +100 -114
  119. package/lib/dependencies/CommonJsPlugin.js +15 -16
  120. package/lib/dependencies/ContextDependencyHelpers.js +2 -1
  121. package/lib/dependencies/ContextDependencyTemplateAsId.js +1 -0
  122. package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +1 -0
  123. package/lib/dependencies/CssIcssExportDependency.js +1 -1
  124. package/lib/dependencies/CssLocalIdentifierDependency.js +2 -2
  125. package/lib/dependencies/CssSelfLocalIdentifierDependency.js +2 -1
  126. package/lib/dependencies/DynamicExports.js +9 -9
  127. package/lib/dependencies/ExportsInfoDependency.js +1 -1
  128. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +122 -101
  129. package/lib/dependencies/HarmonyExportExpressionDependency.js +1 -1
  130. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +95 -19
  131. package/lib/dependencies/HarmonyExportInitFragment.js +1 -1
  132. package/lib/dependencies/HarmonyImportDependency.js +11 -5
  133. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +238 -162
  134. package/lib/dependencies/HarmonyImportSideEffectDependency.js +4 -1
  135. package/lib/dependencies/HarmonyImportSpecifierDependency.js +20 -9
  136. package/lib/dependencies/HarmonyModulesPlugin.js +23 -12
  137. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +1 -0
  138. package/lib/dependencies/ImportMetaContextPlugin.js +2 -1
  139. package/lib/dependencies/ImportMetaPlugin.js +2 -2
  140. package/lib/dependencies/ImportParserPlugin.js +40 -9
  141. package/lib/dependencies/ImportPlugin.js +3 -1
  142. package/lib/dependencies/LoaderPlugin.js +1 -0
  143. package/lib/dependencies/ModuleDependency.js +3 -1
  144. package/lib/dependencies/ModuleDependencyTemplateAsRequireId.js +1 -0
  145. package/lib/dependencies/RequireContextPlugin.js +3 -1
  146. package/lib/dependencies/RequireEnsurePlugin.js +6 -6
  147. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +33 -34
  148. package/lib/dependencies/RequireIncludePlugin.js +1 -0
  149. package/lib/dependencies/RuntimeRequirementsDependency.js +1 -1
  150. package/lib/dependencies/SystemPlugin.js +1 -1
  151. package/lib/dependencies/URLContextDependency.js +65 -0
  152. package/lib/dependencies/URLPlugin.js +17 -157
  153. package/lib/dependencies/WorkerPlugin.js +23 -10
  154. package/lib/dependencies/processExportInfo.js +2 -1
  155. package/lib/esm/ModuleChunkFormatPlugin.js +269 -185
  156. package/lib/esm/ModuleChunkLoadingPlugin.js +39 -1
  157. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +70 -3
  158. package/lib/hmr/HotModuleReplacement.runtime.js +0 -1
  159. package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -1
  160. package/lib/hmr/JavascriptHotModuleReplacementHelper.js +37 -0
  161. package/lib/hmr/LazyCompilationPlugin.js +4 -2
  162. package/lib/hmr/lazyCompilationBackend.js +4 -2
  163. package/lib/ids/ChunkModuleIdRangePlugin.js +6 -3
  164. package/lib/ids/DeterministicChunkIdsPlugin.js +30 -35
  165. package/lib/ids/DeterministicModuleIdsPlugin.js +4 -3
  166. package/lib/ids/HashedModuleIdsPlugin.js +5 -4
  167. package/lib/ids/IdHelpers.js +21 -17
  168. package/lib/ids/NamedChunkIdsPlugin.js +5 -5
  169. package/lib/ids/NamedModuleIdsPlugin.js +4 -4
  170. package/lib/ids/NaturalChunkIdsPlugin.js +2 -1
  171. package/lib/ids/NaturalModuleIdsPlugin.js +1 -1
  172. package/lib/ids/OccurrenceChunkIdsPlugin.js +3 -2
  173. package/lib/ids/OccurrenceModuleIdsPlugin.js +1 -1
  174. package/lib/ids/SyncModuleIdsPlugin.js +1 -1
  175. package/lib/index.js +13 -3
  176. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +113 -119
  177. package/lib/javascript/BasicEvaluatedExpression.js +2 -1
  178. package/lib/javascript/ChunkHelpers.js +1 -0
  179. package/lib/javascript/CommonJsChunkFormatPlugin.js +121 -136
  180. package/lib/javascript/EnableChunkLoadingPlugin.js +6 -3
  181. package/lib/javascript/JavascriptGenerator.js +14 -2
  182. package/lib/javascript/JavascriptModulesPlugin.js +68 -27
  183. package/lib/javascript/JavascriptParser.js +117 -76
  184. package/lib/javascript/JavascriptParserHelpers.js +41 -41
  185. package/lib/javascript/StartupHelpers.js +17 -17
  186. package/lib/json/JsonGenerator.js +4 -2
  187. package/lib/json/JsonModulesPlugin.js +2 -2
  188. package/lib/json/JsonParser.js +1 -1
  189. package/lib/library/AbstractLibraryPlugin.js +6 -2
  190. package/lib/library/AssignLibraryPlugin.js +21 -6
  191. package/lib/library/EnableLibraryPlugin.js +23 -3
  192. package/lib/library/UmdLibraryPlugin.js +15 -6
  193. package/lib/logging/createConsoleLogger.js +3 -3
  194. package/lib/logging/runtime.js +9 -9
  195. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +4 -22
  196. package/lib/node/RequireChunkLoadingRuntimeModule.js +4 -22
  197. package/lib/node/nodeConsole.js +4 -2
  198. package/lib/optimize/AggressiveMergingPlugin.js +45 -46
  199. package/lib/optimize/AggressiveSplittingPlugin.js +13 -12
  200. package/lib/optimize/ConcatenatedModule.js +227 -57
  201. package/lib/optimize/EnsureChunkConditionsPlugin.js +58 -58
  202. package/lib/optimize/FlagIncludedChunksPlugin.js +3 -1
  203. package/lib/optimize/InnerGraph.js +115 -112
  204. package/lib/optimize/InnerGraphPlugin.js +2 -2
  205. package/lib/optimize/LimitChunkCountPlugin.js +4 -2
  206. package/lib/optimize/MangleExportsPlugin.js +4 -3
  207. package/lib/optimize/MergeDuplicateChunksPlugin.js +80 -81
  208. package/lib/optimize/MinChunkSizePlugin.js +6 -3
  209. package/lib/optimize/ModuleConcatenationPlugin.js +31 -22
  210. package/lib/optimize/RealContentHashPlugin.js +26 -20
  211. package/lib/optimize/RemoveEmptyChunksPlugin.js +2 -1
  212. package/lib/optimize/RemoveParentModulesPlugin.js +1 -0
  213. package/lib/optimize/SideEffectsFlagPlugin.js +3 -2
  214. package/lib/optimize/SplitChunksPlugin.js +16 -13
  215. package/lib/rules/BasicEffectRulePlugin.js +4 -2
  216. package/lib/rules/BasicMatcherRulePlugin.js +3 -1
  217. package/lib/rules/ObjectMatcherRulePlugin.js +3 -1
  218. package/lib/rules/RuleSetCompiler.js +19 -5
  219. package/lib/rules/UseEffectRulePlugin.js +17 -9
  220. package/lib/runtime/AsyncModuleRuntimeModule.js +64 -9
  221. package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +1 -1
  222. package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +214 -0
  223. package/lib/runtime/RuntimeIdRuntimeModule.js +2 -1
  224. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +8 -7
  225. package/lib/schemes/FileUriPlugin.js +1 -1
  226. package/lib/schemes/HttpUriPlugin.js +27 -19
  227. package/lib/schemes/VirtualUrlPlugin.js +222 -0
  228. package/lib/serialization/AggregateErrorSerializer.js +1 -1
  229. package/lib/serialization/BinaryMiddleware.js +5 -4
  230. package/lib/serialization/FileMiddleware.js +7 -4
  231. package/lib/serialization/ObjectMiddleware.js +14 -8
  232. package/lib/serialization/Serializer.js +5 -3
  233. package/lib/serialization/SerializerMiddleware.js +2 -0
  234. package/lib/sharing/ConsumeSharedModule.js +1 -1
  235. package/lib/sharing/ConsumeSharedPlugin.js +3 -3
  236. package/lib/sharing/ConsumeSharedRuntimeModule.js +2 -2
  237. package/lib/sharing/ProvideSharedModule.js +1 -1
  238. package/lib/sharing/ProvideSharedPlugin.js +3 -2
  239. package/lib/sharing/SharePlugin.js +2 -1
  240. package/lib/sharing/ShareRuntimeModule.js +3 -5
  241. package/lib/sharing/utils.js +34 -34
  242. package/lib/stats/DefaultStatsFactoryPlugin.js +49 -46
  243. package/lib/stats/DefaultStatsPresetPlugin.js +13 -13
  244. package/lib/stats/DefaultStatsPrinterPlugin.js +15 -9
  245. package/lib/stats/StatsFactory.js +6 -3
  246. package/lib/stats/StatsPrinter.js +6 -7
  247. package/lib/url/URLParserPlugin.js +266 -0
  248. package/lib/util/ArrayQueue.js +1 -1
  249. package/lib/util/AsyncQueue.js +1 -1
  250. package/lib/util/Hash.js +2 -0
  251. package/lib/util/IterableHelpers.js +1 -1
  252. package/lib/util/LazyBucketSortedSet.js +2 -1
  253. package/lib/util/LazySet.js +11 -6
  254. package/lib/util/ParallelismFactorCalculator.js +1 -1
  255. package/lib/util/SetHelpers.js +3 -3
  256. package/lib/util/SortableSet.js +2 -2
  257. package/lib/util/StackedCacheMap.js +3 -1
  258. package/lib/util/StackedMap.js +2 -2
  259. package/lib/util/StringXor.js +1 -0
  260. package/lib/util/TupleSet.js +1 -0
  261. package/lib/util/URLAbsoluteSpecifier.js +1 -1
  262. package/lib/util/cleverMerge.js +95 -58
  263. package/lib/util/comparators.js +154 -127
  264. package/lib/util/compileBooleanMatcher.js +8 -3
  265. package/lib/util/concatenate.js +8 -7
  266. package/lib/util/conventions.js +72 -73
  267. package/lib/util/create-schema-validation.js +2 -1
  268. package/lib/util/createHash.js +10 -4
  269. package/lib/util/deprecation.js +69 -66
  270. package/lib/util/deterministicGrouping.js +4 -2
  271. package/lib/util/extractUrlAndGlobal.js +1 -1
  272. package/lib/util/findGraphRoots.js +2 -2
  273. package/lib/util/fs.js +30 -23
  274. package/lib/util/hash/md4.js +2 -2
  275. package/lib/util/hash/wasm-hash.js +4 -2
  276. package/lib/util/identifier.js +13 -12
  277. package/lib/util/internalSerializables.js +2 -0
  278. package/lib/util/magicComment.js +5 -5
  279. package/lib/util/processAsyncTree.js +1 -1
  280. package/lib/util/propertyAccess.js +1 -1
  281. package/lib/util/propertyName.js +1 -1
  282. package/lib/util/registerExternalSerializer.js +1 -2
  283. package/lib/util/removeBOM.js +1 -1
  284. package/lib/util/runtime.js +29 -21
  285. package/lib/util/semver.js +1 -1
  286. package/lib/util/serialization.js +3 -0
  287. package/lib/util/source.js +3 -2
  288. package/lib/validateSchema.js +1 -0
  289. package/lib/wasm/EnableWasmLoadingPlugin.js +6 -3
  290. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +4 -1
  291. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +46 -49
  292. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +2 -2
  293. package/lib/wasm-sync/WebAssemblyGenerator.js +2 -3
  294. package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +3 -2
  295. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +3 -0
  296. package/lib/wasm-sync/WebAssemblyUtils.js +1 -1
  297. package/lib/web/JsonpChunkLoadingRuntimeModule.js +4 -22
  298. package/lib/webpack.js +4 -5
  299. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +1 -0
  300. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +6 -24
  301. package/lib/webworker/WebWorkerTemplatePlugin.js +1 -0
  302. package/package.json +119 -113
  303. package/schemas/WebpackOptions.check.js +1 -1
  304. package/schemas/WebpackOptions.json +17 -0
  305. package/schemas/plugins/schemes/VirtualUrlPlugin.check.d.ts +7 -0
  306. package/schemas/plugins/schemes/VirtualUrlPlugin.check.js +6 -0
  307. package/schemas/plugins/schemes/VirtualUrlPlugin.json +77 -0
  308. package/types.d.ts +1243 -409
@@ -200,20 +200,27 @@ class FlagDependencyExportsPlugin {
200
200
  name = exportNameOrSpec;
201
201
  } else {
202
202
  name = exportNameOrSpec.name;
203
- if (exportNameOrSpec.canMangle !== undefined)
203
+ if (exportNameOrSpec.canMangle !== undefined) {
204
204
  canMangle = exportNameOrSpec.canMangle;
205
- if (exportNameOrSpec.export !== undefined)
205
+ }
206
+ if (exportNameOrSpec.export !== undefined) {
206
207
  fromExport = exportNameOrSpec.export;
207
- if (exportNameOrSpec.exports !== undefined)
208
+ }
209
+ if (exportNameOrSpec.exports !== undefined) {
208
210
  exports = exportNameOrSpec.exports;
209
- if (exportNameOrSpec.from !== undefined)
211
+ }
212
+ if (exportNameOrSpec.from !== undefined) {
210
213
  from = exportNameOrSpec.from;
211
- if (exportNameOrSpec.priority !== undefined)
214
+ }
215
+ if (exportNameOrSpec.priority !== undefined) {
212
216
  priority = exportNameOrSpec.priority;
213
- if (exportNameOrSpec.terminalBinding !== undefined)
217
+ }
218
+ if (exportNameOrSpec.terminalBinding !== undefined) {
214
219
  terminalBinding = exportNameOrSpec.terminalBinding;
215
- if (exportNameOrSpec.hidden !== undefined)
220
+ }
221
+ if (exportNameOrSpec.hidden !== undefined) {
216
222
  hidden = exportNameOrSpec.hidden;
223
+ }
217
224
  }
218
225
  const exportInfo = exportsInfo.getExportInfo(name);
219
226
 
@@ -274,7 +274,7 @@ class FlagDependencyUsagePlugin {
274
274
  } else {
275
275
  processReferencedModule(
276
276
  module,
277
- Array.from(referencedExports.values()),
277
+ [...referencedExports.values()],
278
278
  runtime,
279
279
  forceSideEffects
280
280
  );
package/lib/Generator.js CHANGED
@@ -9,6 +9,7 @@
9
9
  /** @typedef {import("./ChunkGraph")} ChunkGraph */
10
10
  /** @typedef {import("./CodeGenerationResults")} CodeGenerationResults */
11
11
  /** @typedef {import("./Compilation")} Compilation */
12
+ /** @typedef {import("./Compilation").AssetInfo} AssetInfo */
12
13
  /** @typedef {import("./ConcatenationScope")} ConcatenationScope */
13
14
  /** @typedef {import("./DependencyTemplate")} DependencyTemplate */
14
15
  /** @typedef {import("./DependencyTemplates")} DependencyTemplates */
@@ -21,6 +22,15 @@
21
22
  /** @typedef {import("./util/Hash")} Hash */
22
23
  /** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */
23
24
 
25
+ /**
26
+ * @template T
27
+ * @typedef {import("./InitFragment")<T>} InitFragment
28
+ */
29
+
30
+ /** @typedef {Map<"url", { [key: string]: string }> & Map<"fullContentHash", string> & Map<"contentHash", string> & Map<"filename", string> & Map<"assetInfo", AssetInfo> & Map<"chunkInitFragments", InitFragment<GenerateContext>[]>} KnownGenerateContextData */
31
+
32
+ /** @typedef {KnownGenerateContextData & Record<string, EXPECTED_ANY>} GenerateContextData */
33
+
24
34
  /**
25
35
  * @typedef {object} GenerateContext
26
36
  * @property {DependencyTemplates} dependencyTemplates mapping from dependencies to templates
@@ -32,7 +42,7 @@
32
42
  * @property {ConcatenationScope=} concatenationScope when in concatenated module, information about other concatenated modules
33
43
  * @property {CodeGenerationResults=} codeGenerationResults code generation results of other modules (need to have a codeGenerationDependency to use that)
34
44
  * @property {string} type which kind of code should be generated
35
- * @property {() => Map<string, TODO>=} getData get access to the code generation data
45
+ * @property {() => GenerateContextData=} getData get access to the code generation data
36
46
  */
37
47
 
38
48
  /**
@@ -68,6 +78,7 @@ class Generator {
68
78
  */
69
79
  getTypes(module) {
70
80
  const AbstractMethodError = require("./AbstractMethodError");
81
+
71
82
  throw new AbstractMethodError();
72
83
  }
73
84
 
@@ -80,6 +91,7 @@ class Generator {
80
91
  */
81
92
  getSize(module, type) {
82
93
  const AbstractMethodError = require("./AbstractMethodError");
94
+
83
95
  throw new AbstractMethodError();
84
96
  }
85
97
 
@@ -95,6 +107,7 @@ class Generator {
95
107
  { dependencyTemplates, runtimeTemplate, moduleGraph, type }
96
108
  ) {
97
109
  const AbstractMethodError = require("./AbstractMethodError");
110
+
98
111
  throw new AbstractMethodError();
99
112
  }
100
113
 
@@ -47,6 +47,7 @@ const makeWebpackError = (error, hook) => {
47
47
  if (error instanceof WebpackError) return error;
48
48
  return new HookWebpackError(error, hook);
49
49
  };
50
+
50
51
  module.exports.makeWebpackError = makeWebpackError;
51
52
 
52
53
  /**
@@ -10,6 +10,12 @@ const { RawSource } = require("webpack-sources");
10
10
  const ChunkGraph = require("./ChunkGraph");
11
11
  const Compilation = require("./Compilation");
12
12
  const HotUpdateChunk = require("./HotUpdateChunk");
13
+ const {
14
+ JAVASCRIPT_MODULE_TYPE_AUTO,
15
+ JAVASCRIPT_MODULE_TYPE_DYNAMIC,
16
+ JAVASCRIPT_MODULE_TYPE_ESM,
17
+ WEBPACK_MODULE_TYPE_RUNTIME
18
+ } = require("./ModuleTypeConstants");
13
19
  const NormalModule = require("./NormalModule");
14
20
  const RuntimeGlobals = require("./RuntimeGlobals");
15
21
  const WebpackError = require("./WebpackError");
@@ -27,21 +33,14 @@ const { find, isSubset } = require("./util/SetHelpers");
27
33
  const TupleSet = require("./util/TupleSet");
28
34
  const { compareModulesById } = require("./util/comparators");
29
35
  const {
36
+ forEachRuntime,
30
37
  getRuntimeKey,
38
+ intersectRuntime,
31
39
  keyToRuntime,
32
- forEachRuntime,
33
40
  mergeRuntimeOwned,
34
- subtractRuntime,
35
- intersectRuntime
41
+ subtractRuntime
36
42
  } = require("./util/runtime");
37
43
 
38
- const {
39
- JAVASCRIPT_MODULE_TYPE_AUTO,
40
- JAVASCRIPT_MODULE_TYPE_DYNAMIC,
41
- JAVASCRIPT_MODULE_TYPE_ESM,
42
- WEBPACK_MODULE_TYPE_RUNTIME
43
- } = require("./ModuleTypeConstants");
44
-
45
44
  /** @typedef {import("estree").CallExpression} CallExpression */
46
45
  /** @typedef {import("estree").Expression} Expression */
47
46
  /** @typedef {import("estree").SpreadElement} SpreadElement */
@@ -66,6 +65,13 @@ const {
66
65
  * @property {SyncBailHook<[CallExpression, string[]], void>} hotAcceptWithoutCallback
67
66
  */
68
67
 
68
+ /** @typedef {number} HotIndex */
69
+ /** @typedef {Record<string, string>} FullHashChunkModuleHashes */
70
+ /** @typedef {Record<string, string>} ChunkModuleHashes */
71
+ /** @typedef {Record<ChunkId, string>} ChunkHashes */
72
+ /** @typedef {Record<ChunkId, string>} ChunkRuntime */
73
+ /** @typedef {Record<ChunkId, ModuleId[]>} ChunkModuleIds */
74
+
69
75
  /** @typedef {{ updatedChunkIds: Set<ChunkId>, removedChunkIds: Set<ChunkId>, removedModules: Set<Module>, filename: string, assetInfo: AssetInfo }} HotUpdateMainContentByRuntimeItem */
70
76
  /** @typedef {Map<string, HotUpdateMainContentByRuntimeItem>} HotUpdateMainContentByRuntime */
71
77
 
@@ -103,8 +109,9 @@ class HotModuleReplacementPlugin {
103
109
  */
104
110
  apply(compiler) {
105
111
  const { _backCompat: backCompat } = compiler;
106
- if (compiler.options.output.strictModuleErrorHandling === undefined)
112
+ if (compiler.options.output.strictModuleErrorHandling === undefined) {
107
113
  compiler.options.output.strictModuleErrorHandling = true;
114
+ }
108
115
  const runtimeRequirements = [RuntimeGlobals.module];
109
116
 
110
117
  /**
@@ -344,10 +351,11 @@ class HotModuleReplacementPlugin {
344
351
  );
345
352
  // #endregion
346
353
 
354
+ /** @type {HotIndex} */
347
355
  let hotIndex = 0;
348
- /** @type {Record<string, string>} */
356
+ /** @type {FullHashChunkModuleHashes} */
349
357
  const fullHashChunkModuleHashes = {};
350
- /** @type {Record<string, string>} */
358
+ /** @type {ChunkModuleHashes} */
351
359
  const chunkModuleHashes = {};
352
360
 
353
361
  compilation.hooks.record.tap(PLUGIN_NAME, (compilation, records) => {
@@ -361,19 +369,20 @@ class HotModuleReplacementPlugin {
361
369
  records.chunkRuntime = {};
362
370
  for (const chunk of compilation.chunks) {
363
371
  const chunkId = /** @type {ChunkId} */ (chunk.id);
364
- records.chunkHashes[chunkId] = chunk.hash;
372
+ records.chunkHashes[chunkId] = /** @type {string} */ (chunk.hash);
365
373
  records.chunkRuntime[chunkId] = getRuntimeKey(chunk.runtime);
366
374
  }
367
375
  records.chunkModuleIds = {};
368
376
  for (const chunk of compilation.chunks) {
369
- records.chunkModuleIds[/** @type {ChunkId} */ (chunk.id)] =
370
- Array.from(
371
- chunkGraph.getOrderedChunkModulesIterable(
372
- chunk,
373
- compareModulesById(chunkGraph)
374
- ),
375
- m => chunkGraph.getModuleId(m)
376
- );
377
+ const chunkId = /** @type {ChunkId} */ (chunk.id);
378
+
379
+ records.chunkModuleIds[chunkId] = Array.from(
380
+ chunkGraph.getOrderedChunkModulesIterable(
381
+ chunk,
382
+ compareModulesById(chunkGraph)
383
+ ),
384
+ m => /** @type {ModuleId} */ (chunkGraph.getModuleId(m))
385
+ );
377
386
  }
378
387
  });
379
388
  /** @type {TupleSet<Module, Chunk>} */
@@ -418,10 +427,14 @@ class HotModuleReplacementPlugin {
418
427
  const hash = getModuleHash(module);
419
428
  if (
420
429
  fullHashModulesInThisChunk.has(
421
- /** @type {RuntimeModule} */ (module)
430
+ /** @type {RuntimeModule} */
431
+ (module)
422
432
  )
423
433
  ) {
424
- if (records.fullHashChunkModuleHashes[key] !== hash) {
434
+ if (
435
+ /** @type {FullHashChunkModuleHashes} */
436
+ (records.fullHashChunkModuleHashes)[key] !== hash
437
+ ) {
425
438
  updatedModules.add(module, chunk);
426
439
  }
427
440
  fullHashChunkModuleHashes[key] = hash;
@@ -504,8 +517,11 @@ class HotModuleReplacementPlugin {
504
517
  /** @type {HotUpdateMainContentByRuntime} */
505
518
  const hotUpdateMainContentByRuntime = new Map();
506
519
  let allOldRuntime;
507
- for (const key of Object.keys(records.chunkRuntime)) {
508
- const runtime = keyToRuntime(records.chunkRuntime[key]);
520
+ const chunkRuntime =
521
+ /** @type {ChunkRuntime} */
522
+ (records.chunkRuntime);
523
+ for (const key of Object.keys(chunkRuntime)) {
524
+ const runtime = keyToRuntime(chunkRuntime[key]);
509
525
  allOldRuntime = mergeRuntimeOwned(allOldRuntime, runtime);
510
526
  }
511
527
  forEachRuntime(allOldRuntime, runtime => {
@@ -532,7 +548,7 @@ class HotModuleReplacementPlugin {
532
548
  if (hotUpdateMainContentByRuntime.size === 0) return;
533
549
 
534
550
  // Create a list of all active modules to verify which modules are removed completely
535
- /** @type {Map<number|string, Module>} */
551
+ /** @type {Map<number | string, Module>} */
536
552
  const allModules = new Map();
537
553
  for (const module of compilation.modules) {
538
554
  const id =
@@ -546,7 +562,10 @@ class HotModuleReplacementPlugin {
546
562
  const completelyRemovedModules = new Set();
547
563
 
548
564
  for (const key of Object.keys(records.chunkHashes)) {
549
- const oldRuntime = keyToRuntime(records.chunkRuntime[key]);
565
+ const oldRuntime = keyToRuntime(
566
+ /** @type {ChunkRuntime} */
567
+ (records.chunkRuntime)[key]
568
+ );
550
569
  /** @type {Module[]} */
551
570
  const remainingModules = [];
552
571
  // Check which modules are removed
@@ -581,21 +600,21 @@ class HotModuleReplacementPlugin {
581
600
  newModules = chunkGraph
582
601
  .getChunkModules(currentChunk)
583
602
  .filter(module => updatedModules.has(module, currentChunk));
584
- newRuntimeModules = Array.from(
585
- chunkGraph.getChunkRuntimeModulesIterable(currentChunk)
586
- ).filter(module => updatedModules.has(module, currentChunk));
603
+ newRuntimeModules = [
604
+ ...chunkGraph.getChunkRuntimeModulesIterable(currentChunk)
605
+ ].filter(module => updatedModules.has(module, currentChunk));
587
606
  const fullHashModules =
588
607
  chunkGraph.getChunkFullHashModulesIterable(currentChunk);
589
608
  newFullHashModules =
590
609
  fullHashModules &&
591
- Array.from(fullHashModules).filter(module =>
610
+ [...fullHashModules].filter(module =>
592
611
  updatedModules.has(module, currentChunk)
593
612
  );
594
613
  const dependentHashModules =
595
614
  chunkGraph.getChunkDependentHashModulesIterable(currentChunk);
596
615
  newDependentHashModules =
597
616
  dependentHashModules &&
598
- Array.from(dependentHashModules).filter(module =>
617
+ [...dependentHashModules].filter(module =>
599
618
  updatedModules.has(module, currentChunk)
600
619
  );
601
620
  removedFromRuntime = subtractRuntime(oldRuntime, newRuntime);
@@ -658,8 +677,9 @@ class HotModuleReplacementPlugin {
658
677
  } else if (
659
678
  moduleRuntime !== undefined &&
660
679
  moduleRuntime.has(/** @type {string} */ (runtime))
661
- )
680
+ ) {
662
681
  return;
682
+ }
663
683
  }
664
684
  const item =
665
685
  /** @type {HotUpdateMainContentByRuntimeItem} */ (
@@ -677,15 +697,17 @@ class HotModuleReplacementPlugin {
677
697
  (newRuntimeModules && newRuntimeModules.length > 0)
678
698
  ) {
679
699
  const hotUpdateChunk = new HotUpdateChunk();
680
- if (backCompat)
700
+ if (backCompat) {
681
701
  ChunkGraph.setChunkGraphForChunk(hotUpdateChunk, chunkGraph);
702
+ }
682
703
  hotUpdateChunk.id = chunkId;
683
704
  hotUpdateChunk.runtime = currentChunk
684
705
  ? currentChunk.runtime
685
706
  : newRuntime;
686
707
  if (currentChunk) {
687
- for (const group of currentChunk.groupsIterable)
708
+ for (const group of currentChunk.groupsIterable) {
688
709
  hotUpdateChunk.addGroup(group);
710
+ }
689
711
  }
690
712
  chunkGraph.attachModules(hotUpdateChunk, newModules || []);
691
713
  chunkGraph.attachRuntimeModules(
@@ -706,8 +728,8 @@ class HotModuleReplacementPlugin {
706
728
  }
707
729
  const renderManifest = compilation.getRenderManifest({
708
730
  chunk: hotUpdateChunk,
709
- hash: records.hash,
710
- fullHash: records.hash,
731
+ hash: /** @type {string} */ (records.hash),
732
+ fullHash: /** @type {string} */ (records.hash),
711
733
  outputOptions: compilation.outputOptions,
712
734
  moduleTemplates: compilation.moduleTemplates,
713
735
  dependencyTemplates: compilation.dependencyTemplates,
@@ -753,9 +775,7 @@ class HotModuleReplacementPlugin {
753
775
  });
754
776
  }
755
777
  }
756
- const completelyRemovedModulesArray = Array.from(
757
- completelyRemovedModules
758
- );
778
+ const completelyRemovedModulesArray = [...completelyRemovedModules];
759
779
  const hotUpdateMainContentByFilename = new Map();
760
780
  for (const {
761
781
  removedChunkIds,
@@ -777,12 +797,15 @@ The configured output.hotUpdateMainFilename doesn't lead to unique filenames per
777
797
  This might lead to incorrect runtime behavior of the applied update.
778
798
  To fix this, make sure to include [runtime] in the output.hotUpdateMainFilename option, or use the default config.`)
779
799
  );
780
- for (const chunkId of removedChunkIds)
800
+ for (const chunkId of removedChunkIds) {
781
801
  old.removedChunkIds.add(chunkId);
782
- for (const chunkId of removedModules)
802
+ }
803
+ for (const chunkId of removedModules) {
783
804
  old.removedModules.add(chunkId);
784
- for (const chunkId of updatedChunkIds)
805
+ }
806
+ for (const chunkId of updatedChunkIds) {
785
807
  old.updatedChunkIds.add(chunkId);
808
+ }
786
809
  continue;
787
810
  }
788
811
  hotUpdateMainContentByFilename.set(filename, {
@@ -797,21 +820,25 @@ To fix this, make sure to include [runtime] in the output.hotUpdateMainFilename
797
820
  { removedChunkIds, removedModules, updatedChunkIds, assetInfo }
798
821
  ] of hotUpdateMainContentByFilename) {
799
822
  const hotUpdateMainJson = {
800
- c: Array.from(updatedChunkIds),
801
- r: Array.from(removedChunkIds),
823
+ c: [...updatedChunkIds],
824
+ r: [...removedChunkIds],
802
825
  m:
803
826
  removedModules.size === 0
804
827
  ? completelyRemovedModulesArray
805
- : completelyRemovedModulesArray.concat(
806
- Array.from(
828
+ : [
829
+ ...completelyRemovedModulesArray,
830
+ ...Array.from(
807
831
  removedModules,
808
832
  m =>
809
833
  /** @type {ModuleId} */ (chunkGraph.getModuleId(m))
810
834
  )
811
- )
835
+ ]
812
836
  };
813
837
 
814
- const source = new RawSource(JSON.stringify(hotUpdateMainJson));
838
+ const source = new RawSource(
839
+ (filename.endsWith(".json") ? "" : "export default ") +
840
+ JSON.stringify(hotUpdateMainJson)
841
+ );
815
842
  compilation.emitAsset(filename, source, {
816
843
  hotModuleReplacement: true,
817
844
  ...assetInfo
@@ -14,7 +14,7 @@ const createSchemaValidation = require("./util/create-schema-validation");
14
14
  /** @typedef {import("./NormalModuleFactory").ResolveData} ResolveData */
15
15
 
16
16
  const validate = createSchemaValidation(
17
- require("../schemas/plugins/IgnorePlugin.check.js"),
17
+ require("../schemas/plugins/IgnorePlugin.check"),
18
18
  () => require("../schemas/plugins/IgnorePlugin.json"),
19
19
  {
20
20
  name: "Ignore Plugin",
@@ -80,11 +80,14 @@ class IgnorePlugin {
80
80
  resolveData.dependencies.length > 0 &&
81
81
  resolveData.dependencies[0] instanceof EntryDependency
82
82
  ) {
83
- resolveData.ignoredModule = new RawModule(
83
+ const module = new RawModule(
84
84
  "",
85
85
  "ignored-entry-module",
86
86
  "(ignored-entry-module)"
87
87
  );
88
+ module.factoryMeta = { sideEffectFree: true };
89
+
90
+ resolveData.ignoredModule = module;
88
91
  }
89
92
 
90
93
  return result;
@@ -17,7 +17,7 @@ class InvalidDependenciesModuleWarning extends WebpackError {
17
17
  * @param {Iterable<string>} deps invalid dependencies
18
18
  */
19
19
  constructor(module, deps) {
20
- const orderedDeps = deps ? Array.from(deps).sort() : [];
20
+ const orderedDeps = deps ? [...deps].sort() : [];
21
21
  const depsList = orderedDeps.map(dep => ` * ${JSON.stringify(dep)}`);
22
22
  super(`Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths.
23
23
  Invalid dependencies may lead to broken watching and caching.
@@ -38,7 +38,6 @@ class JavascriptMetaInfoPlugin {
38
38
  /** @type {BuildInfo} */
39
39
  (parser.state.module.buildInfo);
40
40
  buildInfo.moduleConcatenationBailout = "eval()";
41
- buildInfo.usingEval = true;
42
41
  const currentSymbol = InnerGraph.getTopLevelSymbol(parser.state);
43
42
  if (currentSymbol) {
44
43
  InnerGraph.addUsage(parser.state, null, currentSymbol);
@@ -56,7 +56,7 @@ class LibManifestPlugin {
56
56
  // store used paths to detect issue and output an error. #18200
57
57
  const usedPaths = new Set();
58
58
  asyncLib.each(
59
- Array.from(compilation.chunks),
59
+ [...compilation.chunks],
60
60
  (chunk, callback) => {
61
61
  if (!chunk.canBeInitial()) {
62
62
  callback();
@@ -94,7 +94,8 @@ class LibManifestPlugin {
94
94
  const ident = module.libIdent({
95
95
  context:
96
96
  this.options.context ||
97
- /** @type {string} */ (compiler.options.context),
97
+ /** @type {string} */
98
+ (compiler.options.context),
98
99
  associatedObjectForCache: compiler.root
99
100
  });
100
101
  if (ident) {
@@ -140,4 +141,5 @@ class LibManifestPlugin {
140
141
  );
141
142
  }
142
143
  }
144
+
143
145
  module.exports = LibManifestPlugin;
@@ -20,7 +20,7 @@ const createSchemaValidation = require("./util/create-schema-validation");
20
20
  */
21
21
 
22
22
  const validate = createSchemaValidation(
23
- require("../schemas/plugins/LoaderOptionsPlugin.check.js"),
23
+ require("../schemas/plugins/LoaderOptionsPlugin.check"),
24
24
  () => require("../schemas/plugins/LoaderOptionsPlugin.json"),
25
25
  {
26
26
  name: "Loader Options Plugin",
@@ -39,13 +39,15 @@ class LoaderOptionsPlugin {
39
39
  // If no options are set then generate empty options object
40
40
  if (typeof options !== "object") options = {};
41
41
  if (!options.test) {
42
- /** @type {TODO} */
42
+ /** @type {Partial<RegExp>} */
43
43
  const defaultTrueMockRegExp = {
44
44
  test: () => true
45
45
  };
46
46
 
47
47
  /** @type {RegExp} */
48
- options.test = defaultTrueMockRegExp;
48
+ options.test =
49
+ /** @type {RegExp} */
50
+ (defaultTrueMockRegExp);
49
51
  }
50
52
  this.options = options;
51
53
  }
@@ -75,7 +77,7 @@ class LoaderOptionsPlugin {
75
77
  continue;
76
78
  }
77
79
 
78
- /** @type {TODO} */
80
+ /** @type {LoaderContext<EXPECTED_ANY> & Record<string, EXPECTED_ANY>} */
79
81
  (context)[key] = options[key];
80
82
  }
81
83
  }
@@ -5,8 +5,8 @@
5
5
 
6
6
  "use strict";
7
7
 
8
- const { SyncWaterfallHook } = require("tapable");
9
8
  const util = require("util");
9
+ const { SyncWaterfallHook } = require("tapable");
10
10
  const RuntimeGlobals = require("./RuntimeGlobals");
11
11
  const memoize = require("./util/memoize");
12
12
 
@@ -371,7 +371,7 @@ Object.defineProperty(MainTemplate.prototype, "outputOptions", {
371
371
  * @this {MainTemplate}
372
372
  * @returns {OutputOptions} output options
373
373
  */
374
- function () {
374
+ function outputOptions() {
375
375
  return this._outputOptions;
376
376
  },
377
377
  "MainTemplate.outputOptions is deprecated (use Compilation.outputOptions instead)",
package/lib/Module.js CHANGED
@@ -40,12 +40,14 @@ const makeSerializable = require("./util/makeSerializable");
40
40
  /** @typedef {import("./ResolverFactory").ResolverWithOptions} ResolverWithOptions */
41
41
  /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */
42
42
  /** @typedef {import("./WebpackError")} WebpackError */
43
+ /** @typedef {import("./json/JsonData")} JsonData */
43
44
  /** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
44
45
  /** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
45
46
  /** @typedef {import("./util/Hash")} Hash */
46
47
  /** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */
47
48
  /** @typedef {import("./util/identifier").AssociatedObjectForCache} AssociatedObjectForCache */
48
49
  /** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */
50
+ /** @typedef {"namespace" | "default-only" | "default-with-named" | "dynamic"} ExportsType */
49
51
 
50
52
  /**
51
53
  * @template T
@@ -115,6 +117,7 @@ const makeSerializable = require("./util/makeSerializable");
115
117
  * @property {boolean=} sideEffectFree
116
118
  * @property {Record<string, string>=} exportsFinalName
117
119
  * @property {boolean=} isCSSModule
120
+ * @property {Record<string, string>=} jsIncompatibleExports
118
121
  */
119
122
 
120
123
  /**
@@ -133,13 +136,18 @@ const makeSerializable = require("./util/makeSerializable");
133
136
  * @property {LazySet<string>=} buildDependencies using in NormalModule
134
137
  * @property {ValueCacheVersions=} valueDependencies using in NormalModule
135
138
  * @property {Record<string, Source>=} assets using in NormalModule
139
+ * @property {Map<string, AssetInfo | undefined>=} assetsInfo using in NormalModule
136
140
  * @property {string=} hash using in NormalModule
137
141
  * @property {(Snapshot | null)=} snapshot using in ContextModule
138
142
  * @property {string=} fullContentHash for assets modules
139
143
  * @property {string=} filename for assets modules
140
- * @property {Map<string, AssetInfo | undefined>=} assetsInfo for assets modules
141
144
  * @property {boolean=} dataUrl for assets modules
145
+ * @property {AssetInfo=} assetInfo for assets modules
146
+ * @property {boolean=} javascriptModule for external modules
147
+ * @property {boolean=} active for lazy compilation modules
142
148
  * @property {CssData=} cssData for css modules
149
+ * @property {JsonData=} jsonData for json modules
150
+ * @property {Set<string>=} topLevelDeclarations top level declaration names
143
151
  */
144
152
 
145
153
  /** @typedef {Map<string, string | Set<string>>} ValueCacheVersions */
@@ -526,7 +534,7 @@ class Module extends DependenciesBlock {
526
534
  /**
527
535
  * @param {ModuleGraph} moduleGraph the module graph
528
536
  * @param {boolean | undefined} strict the importing module is strict
529
- * @returns {"namespace" | "default-only" | "default-with-named" | "dynamic"} export type
537
+ * @returns {ExportsType} export type
530
538
  * "namespace": Exports is already a namespace object. namespace = exports.
531
539
  * "dynamic": Check at runtime if __esModule is set. When set: namespace = { ...exports, default: exports }. When not set: namespace = { default: exports }.
532
540
  * "default-only": Provide a namespace object with only default export. namespace = { default: exports }
@@ -742,8 +750,9 @@ class Module extends DependenciesBlock {
742
750
  // 1. If module is in one of the chunks of the group we can continue checking the next items
743
751
  // because it's accessible.
744
752
  for (const chunk of cg.chunks) {
745
- if (chunk !== ignoreChunk && chunkGraph.isModuleInChunk(this, chunk))
753
+ if (chunk !== ignoreChunk && chunkGraph.isModuleInChunk(this, chunk)) {
746
754
  continue queueFor;
755
+ }
747
756
  }
748
757
  // 2. If the chunk group is initial, we can break here because it's not accessible.
749
758
  if (chunkGroup.isInitial()) return false;
@@ -771,8 +780,9 @@ class Module extends DependenciesBlock {
771
780
  /** @type {Module} */ (fromModule)
772
781
  )) {
773
782
  // return true if module this is not reachable from originChunk when ignoring chunk
774
- if (!this.isAccessibleInChunk(chunkGraph, originChunk, chunk))
783
+ if (!this.isAccessibleInChunk(chunkGraph, originChunk, chunk)) {
775
784
  return true;
785
+ }
776
786
  }
777
787
  }
778
788
  return false;
@@ -861,6 +871,7 @@ class Module extends DependenciesBlock {
861
871
  */
862
872
  identifier() {
863
873
  const AbstractMethodError = require("./AbstractMethodError");
874
+
864
875
  throw new AbstractMethodError();
865
876
  }
866
877
 
@@ -872,6 +883,7 @@ class Module extends DependenciesBlock {
872
883
  */
873
884
  readableIdentifier(requestShortener) {
874
885
  const AbstractMethodError = require("./AbstractMethodError");
886
+
875
887
  throw new AbstractMethodError();
876
888
  }
877
889
 
@@ -887,6 +899,7 @@ class Module extends DependenciesBlock {
887
899
  */
888
900
  build(options, compilation, resolver, fs, callback) {
889
901
  const AbstractMethodError = require("./AbstractMethodError");
902
+
890
903
  throw new AbstractMethodError();
891
904
  }
892
905
 
@@ -913,6 +926,7 @@ class Module extends DependenciesBlock {
913
926
  source(dependencyTemplates, runtimeTemplate, type = "javascript") {
914
927
  if (this.codeGeneration === Module.prototype.codeGeneration) {
915
928
  const AbstractMethodError = require("./AbstractMethodError");
929
+
916
930
  throw new AbstractMethodError();
917
931
  }
918
932
  const chunkGraph = ChunkGraph.getChunkGraphForModule(
@@ -946,6 +960,7 @@ class Module extends DependenciesBlock {
946
960
  */
947
961
  size(type) {
948
962
  const AbstractMethodError = require("./AbstractMethodError");
963
+
949
964
  throw new AbstractMethodError();
950
965
  }
951
966
 
@@ -1179,7 +1194,7 @@ Object.defineProperty(Module.prototype, "errors", {
1179
1194
  * @this {Module}
1180
1195
  * @returns {WebpackError[]} errors
1181
1196
  */
1182
- function () {
1197
+ function errors() {
1183
1198
  if (this._errors === undefined) {
1184
1199
  this._errors = [];
1185
1200
  }
@@ -1201,7 +1216,7 @@ Object.defineProperty(Module.prototype, "warnings", {
1201
1216
  * @this {Module}
1202
1217
  * @returns {WebpackError[]} warnings
1203
1218
  */
1204
- function () {
1219
+ function warnings() {
1205
1220
  if (this._warnings === undefined) {
1206
1221
  this._warnings = [];
1207
1222
  }
@@ -49,6 +49,7 @@ class ModuleFactory {
49
49
  */
50
50
  create(data, callback) {
51
51
  const AbstractMethodError = require("./AbstractMethodError");
52
+
52
53
  throw new AbstractMethodError();
53
54
  }
54
55
  }