webpack 5.64.3 → 5.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (121) hide show
  1. package/README.md +1 -1
  2. package/lib/Cache.js +1 -1
  3. package/lib/CacheFacade.js +4 -11
  4. package/lib/Chunk.js +2 -0
  5. package/lib/CleanPlugin.js +1 -1
  6. package/lib/Compilation.js +91 -47
  7. package/lib/Compiler.js +57 -3
  8. package/lib/ContextModule.js +21 -17
  9. package/lib/DelegatedModule.js +1 -1
  10. package/lib/Dependency.js +10 -0
  11. package/lib/DependencyTemplate.js +9 -0
  12. package/lib/DependencyTemplates.js +1 -1
  13. package/lib/DllModule.js +1 -1
  14. package/lib/EvalDevToolModulePlugin.js +16 -1
  15. package/lib/EvalSourceMapDevToolPlugin.js +18 -1
  16. package/lib/ExternalModule.js +94 -54
  17. package/lib/ExternalModuleFactoryPlugin.js +1 -1
  18. package/lib/FileSystemInfo.js +29 -25
  19. package/lib/Generator.js +2 -0
  20. package/lib/HookWebpackError.js +1 -1
  21. package/lib/Module.js +25 -2
  22. package/lib/ModuleFilenameHelpers.js +5 -1
  23. package/lib/MultiCompiler.js +1 -1
  24. package/lib/MultiWatching.js +1 -1
  25. package/lib/NormalModule.js +9 -5
  26. package/lib/RawModule.js +1 -1
  27. package/lib/RuntimeGlobals.js +29 -1
  28. package/lib/RuntimeModule.js +1 -1
  29. package/lib/RuntimePlugin.js +50 -0
  30. package/lib/RuntimeTemplate.js +113 -2
  31. package/lib/Template.js +2 -1
  32. package/lib/WatchIgnorePlugin.js +14 -1
  33. package/lib/Watching.js +33 -19
  34. package/lib/WebpackOptionsApply.js +43 -2
  35. package/lib/asset/AssetGenerator.js +71 -30
  36. package/lib/asset/AssetModulesPlugin.js +3 -0
  37. package/lib/asset/RawDataUrlModule.js +148 -0
  38. package/lib/cache/ResolverCachePlugin.js +1 -1
  39. package/lib/cli.js +44 -3
  40. package/lib/config/browserslistTargetHandler.js +38 -1
  41. package/lib/config/defaults.js +79 -6
  42. package/lib/config/normalization.js +5 -0
  43. package/lib/config/target.js +10 -0
  44. package/lib/container/ContainerEntryModule.js +8 -5
  45. package/lib/container/FallbackModule.js +4 -4
  46. package/lib/container/RemoteModule.js +4 -2
  47. package/lib/css/CssExportsGenerator.js +139 -0
  48. package/lib/css/CssGenerator.js +109 -0
  49. package/lib/css/CssLoadingRuntimeModule.js +447 -0
  50. package/lib/css/CssModulesPlugin.js +461 -0
  51. package/lib/css/CssParser.js +618 -0
  52. package/lib/css/walkCssTokens.js +659 -0
  53. package/lib/debug/ProfilingPlugin.js +12 -10
  54. package/lib/dependencies/CreateScriptUrlDependency.js +12 -0
  55. package/lib/dependencies/CssExportDependency.js +85 -0
  56. package/lib/dependencies/CssImportDependency.js +75 -0
  57. package/lib/dependencies/CssLocalIdentifierDependency.js +119 -0
  58. package/lib/dependencies/CssSelfLocalIdentifierDependency.js +101 -0
  59. package/lib/dependencies/CssUrlDependency.js +132 -0
  60. package/lib/dependencies/LoaderPlugin.js +2 -2
  61. package/lib/dependencies/URLDependency.js +3 -8
  62. package/lib/esm/ModuleChunkFormatPlugin.js +74 -49
  63. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +1 -1
  64. package/lib/hmr/LazyCompilationPlugin.js +45 -21
  65. package/lib/hmr/lazyCompilationBackend.js +4 -2
  66. package/lib/ids/DeterministicModuleIdsPlugin.js +55 -35
  67. package/lib/ids/HashedModuleIdsPlugin.js +9 -12
  68. package/lib/ids/IdHelpers.js +24 -10
  69. package/lib/ids/NamedModuleIdsPlugin.js +6 -9
  70. package/lib/ids/NaturalModuleIdsPlugin.js +10 -13
  71. package/lib/ids/OccurrenceModuleIdsPlugin.js +13 -10
  72. package/lib/ids/SyncModuleIdsPlugin.js +140 -0
  73. package/lib/index.js +8 -0
  74. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +2 -2
  75. package/lib/javascript/ChunkHelpers.js +33 -0
  76. package/lib/javascript/JavascriptGenerator.js +1 -0
  77. package/lib/javascript/JavascriptParser.js +16 -8
  78. package/lib/javascript/StartupHelpers.js +4 -28
  79. package/lib/library/AssignLibraryPlugin.js +31 -13
  80. package/lib/library/EnableLibraryPlugin.js +11 -0
  81. package/lib/node/NodeWatchFileSystem.js +85 -31
  82. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +1 -1
  83. package/lib/node/RequireChunkLoadingRuntimeModule.js +1 -1
  84. package/lib/optimize/ConcatenatedModule.js +11 -5
  85. package/lib/runtime/CreateScriptRuntimeModule.js +36 -0
  86. package/lib/runtime/CreateScriptUrlRuntimeModule.js +9 -34
  87. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +76 -0
  88. package/lib/schemes/HttpUriPlugin.js +8 -8
  89. package/lib/sharing/ConsumeSharedModule.js +8 -2
  90. package/lib/sharing/ConsumeSharedRuntimeModule.js +25 -4
  91. package/lib/sharing/ProvideSharedModule.js +4 -2
  92. package/lib/sharing/utils.js +1 -1
  93. package/lib/stats/DefaultStatsFactoryPlugin.js +112 -67
  94. package/lib/stats/DefaultStatsPrinterPlugin.js +89 -24
  95. package/lib/util/AsyncQueue.js +1 -1
  96. package/lib/util/extractUrlAndGlobal.js +3 -0
  97. package/lib/util/fs.js +10 -0
  98. package/lib/util/hash/xxhash64.js +2 -2
  99. package/lib/util/internalSerializables.js +11 -0
  100. package/lib/web/JsonpChunkLoadingRuntimeModule.js +3 -3
  101. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +3 -11
  102. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +3 -2
  103. package/package.json +5 -12
  104. package/schemas/WebpackOptions.check.js +1 -1
  105. package/schemas/WebpackOptions.json +100 -1
  106. package/schemas/plugins/asset/AssetGeneratorOptions.check.js +1 -1
  107. package/schemas/plugins/asset/AssetResourceGeneratorOptions.check.js +1 -1
  108. package/schemas/plugins/container/ContainerPlugin.check.js +1 -1
  109. package/schemas/plugins/container/ContainerPlugin.json +2 -1
  110. package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
  111. package/schemas/plugins/container/ContainerReferencePlugin.json +1 -0
  112. package/schemas/plugins/container/ExternalsType.check.js +1 -1
  113. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  114. package/schemas/plugins/container/ModuleFederationPlugin.json +3 -1
  115. package/schemas/plugins/css/CssGeneratorOptions.check.d.ts +7 -0
  116. package/schemas/plugins/css/CssGeneratorOptions.check.js +6 -0
  117. package/schemas/plugins/css/CssGeneratorOptions.json +3 -0
  118. package/schemas/plugins/css/CssParserOptions.check.d.ts +7 -0
  119. package/schemas/plugins/css/CssParserOptions.check.js +6 -0
  120. package/schemas/plugins/css/CssParserOptions.json +3 -0
  121. package/types.d.ts +305 -58
@@ -9,6 +9,8 @@
9
9
  /** @typedef {import("./StatsPrinter")} StatsPrinter */
10
10
  /** @typedef {import("./StatsPrinter").StatsPrinterContext} StatsPrinterContext */
11
11
 
12
+ const DATA_URI_CONTENT_LENGTH = 16;
13
+
12
14
  const plural = (n, singular, plural) => (n === 1 ? singular : plural);
13
15
 
14
16
  /**
@@ -26,6 +28,23 @@ const printSizes = (sizes, { formatSize = n => `${n}` }) => {
26
28
  }
27
29
  };
28
30
 
31
+ const getResourceName = resource => {
32
+ const dataUrl = /^data:[^,]+,/.exec(resource);
33
+ if (!dataUrl) return resource;
34
+
35
+ const len = dataUrl[0].length + DATA_URI_CONTENT_LENGTH;
36
+ if (resource.length < len) return resource;
37
+ return `${resource.slice(
38
+ 0,
39
+ Math.min(resource.length - /* '..'.length */ 2, len)
40
+ )}..`;
41
+ };
42
+
43
+ const getModuleName = name => {
44
+ const [, prefix, resource] = /^(.*!)?([^!]*)$/.exec(name);
45
+ return [prefix, getResourceName(resource)];
46
+ };
47
+
29
48
  const mapLines = (str, fn) => str.split("\n").map(fn).join("\n");
30
49
 
31
50
  /**
@@ -38,6 +57,10 @@ const isValidId = id => {
38
57
  return typeof id === "number" || id;
39
58
  };
40
59
 
60
+ const moreCount = (list, count) => {
61
+ return list && list.length > 0 ? `+ ${count}` : `${count}`;
62
+ };
63
+
41
64
  /** @type {Record<string, (thing: any, context: StatsPrinterContext, printer: StatsPrinter) => string | void>} */
42
65
  const SIMPLE_PRINTERS = {
43
66
  "compilation.summary!": (
@@ -163,13 +186,24 @@ const SIMPLE_PRINTERS = {
163
186
  },
164
187
  "compilation.assetsByChunkName": () => "",
165
188
 
166
- "compilation.filteredModules": filteredModules =>
189
+ "compilation.filteredModules": (
190
+ filteredModules,
191
+ { compilation: { modules } }
192
+ ) =>
167
193
  filteredModules > 0
168
- ? `${filteredModules} ${plural(filteredModules, "module", "modules")}`
194
+ ? `${moreCount(modules, filteredModules)} ${plural(
195
+ filteredModules,
196
+ "module",
197
+ "modules"
198
+ )}`
169
199
  : undefined,
170
200
  "compilation.filteredAssets": (filteredAssets, { compilation: { assets } }) =>
171
201
  filteredAssets > 0
172
- ? `${filteredAssets} ${plural(filteredAssets, "asset", "assets")}`
202
+ ? `${moreCount(assets, filteredAssets)} ${plural(
203
+ filteredAssets,
204
+ "asset",
205
+ "assets"
206
+ )}`
173
207
  : undefined,
174
208
  "compilation.logging": (logging, context, printer) =>
175
209
  Array.isArray(logging)
@@ -262,15 +296,19 @@ const SIMPLE_PRINTERS = {
262
296
  "asset.separator!": () => "\n",
263
297
  "asset.filteredRelated": (filteredRelated, { asset: { related } }) =>
264
298
  filteredRelated > 0
265
- ? `${filteredRelated} related ${plural(
299
+ ? `${moreCount(related, filteredRelated)} related ${plural(
266
300
  filteredRelated,
267
301
  "asset",
268
302
  "assets"
269
303
  )}`
270
304
  : undefined,
271
- "asset.filteredChildren": filteredChildren =>
305
+ "asset.filteredChildren": (filteredChildren, { asset: { children } }) =>
272
306
  filteredChildren > 0
273
- ? `${filteredChildren} ${plural(filteredChildren, "asset", "assets")}`
307
+ ? `${moreCount(children, filteredChildren)} ${plural(
308
+ filteredChildren,
309
+ "asset",
310
+ "assets"
311
+ )}`
274
312
  : undefined,
275
313
 
276
314
  assetChunk: (id, { formatChunkId }) => formatChunkId(id),
@@ -282,8 +320,8 @@ const SIMPLE_PRINTERS = {
282
320
  "module.id": (id, { formatModuleId }) =>
283
321
  isValidId(id) ? formatModuleId(id) : undefined,
284
322
  "module.name": (name, { bold }) => {
285
- const [, prefix, resource] = /^(.*!)?([^!]*)$/.exec(name);
286
- return (prefix || "") + bold(resource);
323
+ const [prefix, resource] = getModuleName(name);
324
+ return `${prefix || ""}${bold(resource || "")}`;
287
325
  },
288
326
  "module.identifier": identifier => undefined,
289
327
  "module.layer": (layer, { formatLayer }) =>
@@ -366,21 +404,29 @@ const SIMPLE_PRINTERS = {
366
404
  "module.issuerPath": (issuerPath, { module }) =>
367
405
  module.profile ? undefined : "",
368
406
  "module.profile": profile => undefined,
369
- "module.filteredModules": filteredModules =>
407
+ "module.filteredModules": (filteredModules, { module: { modules } }) =>
370
408
  filteredModules > 0
371
- ? `${filteredModules} nested ${plural(
409
+ ? `${moreCount(modules, filteredModules)} nested ${plural(
372
410
  filteredModules,
373
411
  "module",
374
412
  "modules"
375
413
  )}`
376
414
  : undefined,
377
- "module.filteredReasons": filteredReasons =>
415
+ "module.filteredReasons": (filteredReasons, { module: { reasons } }) =>
378
416
  filteredReasons > 0
379
- ? `${filteredReasons} ${plural(filteredReasons, "reason", "reasons")}`
417
+ ? `${moreCount(reasons, filteredReasons)} ${plural(
418
+ filteredReasons,
419
+ "reason",
420
+ "reasons"
421
+ )}`
380
422
  : undefined,
381
- "module.filteredChildren": filteredChildren =>
423
+ "module.filteredChildren": (filteredChildren, { module: { children } }) =>
382
424
  filteredChildren > 0
383
- ? `${filteredChildren} ${plural(filteredChildren, "module", "modules")}`
425
+ ? `${moreCount(children, filteredChildren)} ${plural(
426
+ filteredChildren,
427
+ "module",
428
+ "modules"
429
+ )}`
384
430
  : undefined,
385
431
  "module.separator!": () => "\n",
386
432
 
@@ -388,7 +434,8 @@ const SIMPLE_PRINTERS = {
388
434
  "moduleIssuer.profile.total": (value, { formatTime }) => formatTime(value),
389
435
 
390
436
  "moduleReason.type": type => type,
391
- "moduleReason.userRequest": (userRequest, { cyan }) => cyan(userRequest),
437
+ "moduleReason.userRequest": (userRequest, { cyan }) =>
438
+ cyan(getResourceName(userRequest)),
392
439
  "moduleReason.moduleId": (moduleId, { formatModuleId }) =>
393
440
  isValidId(moduleId) ? formatModuleId(moduleId) : undefined,
394
441
  "moduleReason.module": (module, { magenta }) => magenta(module),
@@ -397,9 +444,16 @@ const SIMPLE_PRINTERS = {
397
444
  "moduleReason.active": (active, { formatFlag }) =>
398
445
  active ? undefined : formatFlag("inactive"),
399
446
  "moduleReason.resolvedModule": (module, { magenta }) => magenta(module),
400
- "moduleReason.filteredChildren": filteredChildren =>
447
+ "moduleReason.filteredChildren": (
448
+ filteredChildren,
449
+ { moduleReason: { children } }
450
+ ) =>
401
451
  filteredChildren > 0
402
- ? `${filteredChildren} ${plural(filteredChildren, "reason", "reasons")}`
452
+ ? `${moreCount(children, filteredChildren)} ${plural(
453
+ filteredChildren,
454
+ "reason",
455
+ "reasons"
456
+ )}`
403
457
  : undefined,
404
458
 
405
459
  "module.profile.total": (value, { formatTime }) => formatTime(value),
@@ -427,10 +481,21 @@ const SIMPLE_PRINTERS = {
427
481
  size ? formatSize(size) : undefined,
428
482
  "chunkGroup.auxiliaryAssetsSize": (size, { formatSize }) =>
429
483
  size ? `(${formatSize(size)})` : undefined,
430
- "chunkGroup.filteredAssets": n =>
431
- n > 0 ? `${n} ${plural(n, "asset", "assets")}` : undefined,
432
- "chunkGroup.filteredAuxiliaryAssets": n =>
433
- n > 0 ? `${n} auxiliary ${plural(n, "asset", "assets")}` : undefined,
484
+ "chunkGroup.filteredAssets": (n, { chunkGroup: { assets } }) =>
485
+ n > 0
486
+ ? `${moreCount(assets, n)} ${plural(n, "asset", "assets")}`
487
+ : undefined,
488
+ "chunkGroup.filteredAuxiliaryAssets": (
489
+ n,
490
+ { chunkGroup: { auxiliaryAssets } }
491
+ ) =>
492
+ n > 0
493
+ ? `${moreCount(auxiliaryAssets, n)} auxiliary ${plural(
494
+ n,
495
+ "asset",
496
+ "assets"
497
+ )}`
498
+ : undefined,
434
499
  "chunkGroup.is!": () => "=",
435
500
  "chunkGroupAsset.name": (asset, { green }) => green(asset),
436
501
  "chunkGroupAsset.size": (size, { formatSize, chunkGroup }) =>
@@ -490,9 +555,9 @@ const SIMPLE_PRINTERS = {
490
555
  "chunk.recorded": (recorded, { formatFlag, green }) =>
491
556
  recorded ? green(formatFlag("recorded")) : undefined,
492
557
  "chunk.reason": (reason, { yellow }) => (reason ? yellow(reason) : undefined),
493
- "chunk.filteredModules": filteredModules =>
558
+ "chunk.filteredModules": (filteredModules, { chunk: { modules } }) =>
494
559
  filteredModules > 0
495
- ? `${filteredModules} chunk ${plural(
560
+ ? `${moreCount(modules, filteredModules)} chunk ${plural(
496
561
  filteredModules,
497
562
  "module",
498
563
  "modules"
@@ -1160,7 +1225,7 @@ const AVAILABLE_FORMATS = {
1160
1225
  },
1161
1226
  { regExp: /(\(module has no exports\))/g, format: red },
1162
1227
  { regExp: /\(possible exports: (.+)\)/g, format: green },
1163
- { regExp: /\s*([^\s].* doesn't exist)/g, format: red },
1228
+ { regExp: /(?:^|\n)(.* doesn't exist)/g, format: red },
1164
1229
  { regExp: /('\w+' option has not been set)/g, format: red },
1165
1230
  {
1166
1231
  regExp: /(Emitted value instead of an instance of Error)/g,
@@ -19,7 +19,7 @@ let inHandleResult = 0;
19
19
  /**
20
20
  * @template T
21
21
  * @callback Callback
22
- * @param {WebpackError=} err
22
+ * @param {(WebpackError | null)=} err
23
23
  * @param {T=} result
24
24
  */
25
25
 
@@ -11,5 +11,8 @@
11
11
  */
12
12
  module.exports = function extractUrlAndGlobal(urlAndGlobal) {
13
13
  const index = urlAndGlobal.indexOf("@");
14
+ if (index <= 0 || index === urlAndGlobal.length - 1) {
15
+ throw new Error(`Invalid request "${urlAndGlobal}"`);
16
+ }
14
17
  return [urlAndGlobal.substring(index + 1), urlAndGlobal.substring(0, index)];
15
18
  };
package/lib/util/fs.js CHANGED
@@ -61,6 +61,15 @@ const path = require("path");
61
61
  /** @typedef {function((NodeJS.ErrnoException | Error | null)=, any=): void} ReadJsonCallback */
62
62
  /** @typedef {function((NodeJS.ErrnoException | Error | null)=, IStats|string=): void} LstatReadlinkAbsoluteCallback */
63
63
 
64
+ /**
65
+ * @typedef {Object} WatcherInfo
66
+ * @property {Set<string>} changes get current aggregated changes that have not yet send to callback
67
+ * @property {Set<string>} removals get current aggregated removals that have not yet send to callback
68
+ * @property {Map<string, FileSystemInfoEntry | "ignore">} fileTimeInfoEntries get info about files
69
+ * @property {Map<string, FileSystemInfoEntry | "ignore">} contextTimeInfoEntries get info about directories
70
+ */
71
+
72
+ // TODO webpack 6 deprecate missing getInfo
64
73
  /**
65
74
  * @typedef {Object} Watcher
66
75
  * @property {function(): void} close closes the watcher and all underlying file watchers
@@ -69,6 +78,7 @@ const path = require("path");
69
78
  * @property {function(): Set<string>=} getAggregatedRemovals get current aggregated removals that have not yet send to callback
70
79
  * @property {function(): Map<string, FileSystemInfoEntry | "ignore">} getFileTimeInfoEntries get info about files
71
80
  * @property {function(): Map<string, FileSystemInfoEntry | "ignore">} getContextTimeInfoEntries get info about directories
81
+ * @property {function(): WatcherInfo=} getInfo get info about timestamps and changes
72
82
  */
73
83
 
74
84
  /**
@@ -10,8 +10,8 @@ const create = require("./wasm-hash");
10
10
  //#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1
11
11
  const xxhash64 = new WebAssembly.Module(
12
12
  Buffer.from(
13
- // 1173 bytes
14
- "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrUIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0Of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xjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL",
15
15
  "base64"
16
16
  )
17
17
  );
@@ -67,6 +67,16 @@ module.exports = {
67
67
  require("../dependencies/ContextElementDependency"),
68
68
  "dependencies/CriticalDependencyWarning": () =>
69
69
  require("../dependencies/CriticalDependencyWarning"),
70
+ "dependencies/CssImportDependency": () =>
71
+ require("../dependencies/CssImportDependency"),
72
+ "dependencies/CssLocalIdentifierDependency": () =>
73
+ require("../dependencies/CssLocalIdentifierDependency"),
74
+ "dependencies/CssSelfLocalIdentifierDependency": () =>
75
+ require("../dependencies/CssSelfLocalIdentifierDependency"),
76
+ "dependencies/CssExportDependency": () =>
77
+ require("../dependencies/CssExportDependency"),
78
+ "dependencies/CssUrlDependency": () =>
79
+ require("../dependencies/CssUrlDependency"),
70
80
  "dependencies/DelegatedSourceDependency": () =>
71
81
  require("../dependencies/DelegatedSourceDependency"),
72
82
  "dependencies/DllEntryDependency": () =>
@@ -175,6 +185,7 @@ module.exports = {
175
185
  ModuleParseError: () => require("../ModuleParseError"),
176
186
  ModuleWarning: () => require("../ModuleWarning"),
177
187
  NormalModule: () => require("../NormalModule"),
188
+ RawDataUrlModule: () => require("../asset/RawDataUrlModule"),
178
189
  RawModule: () => require("../RawModule"),
179
190
  "sharing/ConsumeSharedModule": () =>
180
191
  require("../sharing/ConsumeSharedModule"),
@@ -59,13 +59,13 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
59
59
  const {
60
60
  runtimeTemplate,
61
61
  outputOptions: {
62
- globalObject,
63
62
  chunkLoadingGlobal,
64
63
  hotUpdateGlobal,
65
64
  crossOriginLoading,
66
65
  scriptType
67
66
  }
68
67
  } = compilation;
68
+ const globalObject = runtimeTemplate.globalObject;
69
69
  const { linkPreload, linkPrefetch } =
70
70
  JsonpChunkLoadingRuntimeModule.getCompilationHooks(compilation);
71
71
  const fn = RuntimeGlobals.ensureChunkHandlers;
@@ -96,7 +96,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
96
96
  )}]`;
97
97
  const conditionMap = chunkGraph.getChunkConditionMap(chunk, chunkHasJs);
98
98
  const hasJsMatcher = compileBooleanMatcher(conditionMap);
99
- const initialChunkIds = getInitialChunkIds(chunk, chunkGraph);
99
+ const initialChunkIds = getInitialChunkIds(chunk, chunkGraph, chunkHasJs);
100
100
 
101
101
  const stateExpression = withHmr
102
102
  ? `${RuntimeGlobals.hmrRuntimeStatePrefix}_jsonp`
@@ -419,7 +419,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
419
419
  `if(${RuntimeGlobals.hasOwnProperty}(installedChunks, chunkId) && installedChunks[chunkId]) {`,
420
420
  Template.indent("installedChunks[chunkId][0]();"),
421
421
  "}",
422
- "installedChunks[chunkIds[i]] = 0;"
422
+ "installedChunks[chunkId] = 0;"
423
423
  ]),
424
424
  "}",
425
425
  withOnChunkLoad
@@ -6,7 +6,6 @@
6
6
  "use strict";
7
7
 
8
8
  const RuntimeGlobals = require("../RuntimeGlobals");
9
- const CreateScriptUrlRuntimeModule = require("../runtime/CreateScriptUrlRuntimeModule");
10
9
  const StartupChunkDependenciesPlugin = require("../runtime/StartupChunkDependenciesPlugin");
11
10
  const ImportScriptsChunkLoadingRuntimeModule = require("./ImportScriptsChunkLoadingRuntimeModule");
12
11
 
@@ -43,7 +42,9 @@ class ImportScriptsChunkLoadingPlugin {
43
42
  const withCreateScriptUrl = !!compilation.outputOptions.trustedTypes;
44
43
  set.add(RuntimeGlobals.moduleFactoriesAddOnly);
45
44
  set.add(RuntimeGlobals.hasOwnProperty);
46
- if (withCreateScriptUrl) set.add(RuntimeGlobals.createScriptUrl);
45
+ if (withCreateScriptUrl) {
46
+ set.add(RuntimeGlobals.createScriptUrl);
47
+ }
47
48
  compilation.addRuntimeModule(
48
49
  chunk,
49
50
  new ImportScriptsChunkLoadingRuntimeModule(set, withCreateScriptUrl)
@@ -61,15 +62,6 @@ class ImportScriptsChunkLoadingPlugin {
61
62
  compilation.hooks.runtimeRequirementInTree
62
63
  .for(RuntimeGlobals.baseURI)
63
64
  .tap("ImportScriptsChunkLoadingPlugin", handler);
64
- compilation.hooks.runtimeRequirementInTree
65
- .for(RuntimeGlobals.createScriptUrl)
66
- .tap("RuntimePlugin", (chunk, set) => {
67
- compilation.addRuntimeModule(
68
- chunk,
69
- new CreateScriptUrlRuntimeModule()
70
- );
71
- return true;
72
- });
73
65
 
74
66
  compilation.hooks.runtimeRequirementInTree
75
67
  .for(RuntimeGlobals.ensureChunkHandlers)
@@ -31,10 +31,11 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {
31
31
  chunkGraph,
32
32
  compilation: {
33
33
  runtimeTemplate,
34
- outputOptions: { globalObject, chunkLoadingGlobal, hotUpdateGlobal }
34
+ outputOptions: { chunkLoadingGlobal, hotUpdateGlobal }
35
35
  },
36
36
  _withCreateScriptUrl: withCreateScriptUrl
37
37
  } = this;
38
+ const globalObject = runtimeTemplate.globalObject;
38
39
  const fn = RuntimeGlobals.ensureChunkHandlers;
39
40
  const withBaseURI = this.runtimeRequirements.has(RuntimeGlobals.baseURI);
40
41
  const withLoading = this.runtimeRequirements.has(
@@ -52,7 +53,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {
52
53
  const hasJsMatcher = compileBooleanMatcher(
53
54
  chunkGraph.getChunkConditionMap(chunk, chunkHasJs)
54
55
  );
55
- const initialChunkIds = getInitialChunkIds(chunk, chunkGraph);
56
+ const initialChunkIds = getInitialChunkIds(chunk, chunkGraph, chunkHasJs);
56
57
 
57
58
  const outputName = this.compilation.getPath(
58
59
  getChunkFilenameTemplate(chunk, this.compilation.outputOptions),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "5.64.3",
3
+ "version": "5.67.0",
4
4
  "author": "Tobias Koppers @sokra",
5
5
  "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
6
6
  "license": "MIT",
@@ -19,7 +19,7 @@
19
19
  "eslint-scope": "5.1.1",
20
20
  "events": "^3.2.0",
21
21
  "glob-to-regexp": "^0.4.1",
22
- "graceful-fs": "^4.2.4",
22
+ "graceful-fs": "^4.2.9",
23
23
  "json-parse-better-errors": "^1.0.2",
24
24
  "loader-runner": "^4.2.0",
25
25
  "mime-types": "^2.1.27",
@@ -27,8 +27,8 @@
27
27
  "schema-utils": "^3.1.0",
28
28
  "tapable": "^2.1.1",
29
29
  "terser-webpack-plugin": "^5.1.3",
30
- "watchpack": "^2.2.0",
31
- "webpack-sources": "^3.2.2"
30
+ "watchpack": "^2.3.1",
31
+ "webpack-sources": "^3.2.3"
32
32
  },
33
33
  "peerDependenciesMeta": {
34
34
  "webpack-cli": {
@@ -143,13 +143,6 @@
143
143
  "test:integration": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --logHeapUsage --testMatch \"<rootDir>/test/*.{basictest,longtest,test}.js\"",
144
144
  "test:basic": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --logHeapUsage --testMatch \"<rootDir>/test/*.basictest.js\"",
145
145
  "test:unit": "node --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.unittest.js\"",
146
- "travis:integration": "yarn cover:integration --ci $JEST",
147
- "travis:basic": "yarn cover:basic --ci $JEST",
148
- "travis:lintunit": "yarn lint && yarn cover:unit --ci $JEST",
149
- "travis:benchmark": "yarn benchmark --ci",
150
- "appveyor:integration": "yarn cover:integration --ci %JEST%",
151
- "appveyor:unit": "yarn cover:unit --ci %JEST%",
152
- "appveyor:benchmark": "yarn benchmark --ci",
153
146
  "build:examples": "cd examples && node buildAll.js",
154
147
  "type-report": "rimraf coverage && yarn cover:types && yarn cover:report && open-cli coverage/lcov-report/index.html",
155
148
  "pretest": "yarn lint",
@@ -159,7 +152,7 @@
159
152
  "type-lint": "tsc",
160
153
  "typings-test": "tsc -p tsconfig.types.test.json",
161
154
  "module-typings-test": "tsc -p tsconfig.module.test.json",
162
- "spellcheck": "cspell \"{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}\" \"*.md\"",
155
+ "spellcheck": "cspell \"**/*\"",
163
156
  "special-lint": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/schemas-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/format-schemas && node tooling/generate-runtime-code.js && node tooling/generate-wasm-code.js && node node_modules/tooling/format-file-header && node node_modules/tooling/compile-to-definitions && node node_modules/tooling/precompile-schemas && node node_modules/tooling/generate-types --no-template-literals",
164
157
  "special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node tooling/generate-wasm-code.js --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/precompile-schemas --write && node node_modules/tooling/generate-types --no-template-literals --write",
165
158
  "fix": "yarn code-lint --fix && yarn special-lint-fix && yarn pretty-lint-fix",