webpack 5.49.0 → 5.51.2

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 (41) hide show
  1. package/README.md +4 -16
  2. package/bin/webpack.js +0 -0
  3. package/lib/ChunkGraph.js +75 -1
  4. package/lib/CompatibilityPlugin.js +21 -4
  5. package/lib/Compilation.js +10 -1
  6. package/lib/Compiler.js +7 -0
  7. package/lib/EvalSourceMapDevToolPlugin.js +2 -2
  8. package/lib/FileSystemInfo.js +660 -191
  9. package/lib/HotModuleReplacementPlugin.js +14 -0
  10. package/lib/NormalModule.js +13 -3
  11. package/lib/Parser.js +1 -0
  12. package/lib/RuntimeGlobals.js +5 -0
  13. package/lib/RuntimeModule.js +2 -1
  14. package/lib/SourceMapDevToolPlugin.js +2 -2
  15. package/lib/Watching.js +8 -10
  16. package/lib/config/defaults.js +1 -1
  17. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +6 -2
  18. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +10 -1
  19. package/lib/javascript/JavascriptParser.js +2 -0
  20. package/lib/library/ModuleLibraryPlugin.js +4 -0
  21. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +7 -1
  22. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +2 -2
  23. package/lib/node/ReadFileCompileWasmPlugin.js +2 -1
  24. package/lib/node/RequireChunkLoadingRuntimeModule.js +7 -1
  25. package/lib/optimize/ConcatenatedModule.js +3 -3
  26. package/lib/optimize/SplitChunksPlugin.js +1 -1
  27. package/lib/runtime/GetChunkFilenameRuntimeModule.js +1 -0
  28. package/lib/serialization/BinaryMiddleware.js +293 -265
  29. package/lib/util/fs.js +40 -0
  30. package/lib/util/identifier.js +26 -8
  31. package/lib/util/propertyAccess.js +54 -1
  32. package/lib/wasm-async/{AsyncWasmChunkLoadingRuntimeModule.js → AsyncWasmLoadingRuntimeModule.js} +3 -3
  33. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +18 -2
  34. package/lib/web/FetchCompileAsyncWasmPlugin.js +2 -2
  35. package/lib/web/FetchCompileWasmPlugin.js +2 -1
  36. package/lib/web/JsonpChunkLoadingRuntimeModule.js +21 -8
  37. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +7 -1
  38. package/package.json +2 -1
  39. package/schemas/WebpackOptions.json +1 -1
  40. package/schemas/plugins/schemes/HttpUriPlugin.json +1 -1
  41. package/types.d.ts +63 -9
@@ -15,6 +15,13 @@ const WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g;
15
15
  * @property {Map<string, Map<string, string>>=} relativePaths
16
16
  */
17
17
 
18
+ const relativePathToRequest = relativePath => {
19
+ if (relativePath === "") return "./.";
20
+ if (relativePath === "..") return "../.";
21
+ if (relativePath.startsWith("../")) return relativePath;
22
+ return `./${relativePath}`;
23
+ };
24
+
18
25
  /**
19
26
  * @param {string} context context for relative path
20
27
  * @param {string} maybeAbsolutePath path to make relative
@@ -36,10 +43,7 @@ const absoluteToRequest = (context, maybeAbsolutePath) => {
36
43
  querySplitPos === -1
37
44
  ? maybeAbsolutePath
38
45
  : maybeAbsolutePath.slice(0, querySplitPos);
39
- resource = path.posix.relative(context, resource);
40
- if (!resource.startsWith("../")) {
41
- resource = "./" + resource;
42
- }
46
+ resource = relativePathToRequest(path.posix.relative(context, resource));
43
47
  return querySplitPos === -1
44
48
  ? resource
45
49
  : resource + maybeAbsolutePath.slice(querySplitPos);
@@ -53,10 +57,9 @@ const absoluteToRequest = (context, maybeAbsolutePath) => {
53
57
  : maybeAbsolutePath.slice(0, querySplitPos);
54
58
  resource = path.win32.relative(context, resource);
55
59
  if (!WINDOWS_ABS_PATH_REGEXP.test(resource)) {
56
- resource = resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, "/");
57
- if (!resource.startsWith("../")) {
58
- resource = "./" + resource;
59
- }
60
+ resource = relativePathToRequest(
61
+ resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, "/")
62
+ );
60
63
  }
61
64
  return querySplitPos === -1
62
65
  ? resource
@@ -214,6 +217,21 @@ const _makePathsRelative = (context, identifier) => {
214
217
 
215
218
  exports.makePathsRelative = makeCacheable(_makePathsRelative);
216
219
 
220
+ /**
221
+ *
222
+ * @param {string} context context for relative path
223
+ * @param {string} identifier identifier for path
224
+ * @returns {string} a converted relative path
225
+ */
226
+ const _makePathsAbsolute = (context, identifier) => {
227
+ return identifier
228
+ .split(SEGMENTS_SPLIT_REGEXP)
229
+ .map(str => requestToAbsolute(context, str))
230
+ .join("");
231
+ };
232
+
233
+ exports.makePathsAbsolute = makeCacheable(_makePathsAbsolute);
234
+
217
235
  /**
218
236
  * @param {string} context absolute context path
219
237
  * @param {string} request any request string may containing absolute paths, query string, etc.
@@ -6,6 +6,59 @@
6
6
  "use strict";
7
7
 
8
8
  const SAFE_IDENTIFIER = /^[_a-zA-Z$][_a-zA-Z$0-9]*$/;
9
+ const RESERVED_IDENTIFER = new Set([
10
+ "break",
11
+ "case",
12
+ "catch",
13
+ "class",
14
+ "const",
15
+ "continue",
16
+ "debugger",
17
+ "default",
18
+ "delete",
19
+ "do",
20
+ "else",
21
+ "export",
22
+ "extends",
23
+ "finally",
24
+ "for",
25
+ "function",
26
+ "if",
27
+ "import",
28
+ "in",
29
+ "instanceof",
30
+ "new",
31
+ "return",
32
+ "super",
33
+ "switch",
34
+ "this",
35
+ "throw",
36
+ "try",
37
+ "typeof",
38
+ "var",
39
+ "void",
40
+ "while",
41
+ "with",
42
+ "enum",
43
+ // strict mode
44
+ "implements",
45
+ "interface",
46
+ "let",
47
+ "package",
48
+ "private",
49
+ "protected",
50
+ "public",
51
+ "static",
52
+ "yield",
53
+ "yield",
54
+ // module code
55
+ "await",
56
+ // skip future reserved keywords defined under ES1 till ES3
57
+ // additional
58
+ "null",
59
+ "true",
60
+ "false"
61
+ ]);
9
62
 
10
63
  const propertyAccess = (properties, start = 0) => {
11
64
  let str = "";
@@ -13,7 +66,7 @@ const propertyAccess = (properties, start = 0) => {
13
66
  const p = properties[i];
14
67
  if (`${+p}` === p) {
15
68
  str += `[${p}]`;
16
- } else if (SAFE_IDENTIFIER.test(p)) {
69
+ } else if (SAFE_IDENTIFIER.test(p) && !RESERVED_IDENTIFER.has(p)) {
17
70
  str += `.${p}`;
18
71
  } else {
19
72
  str += `[${JSON.stringify(p)}]`;
@@ -9,9 +9,9 @@ const RuntimeGlobals = require("../RuntimeGlobals");
9
9
  const RuntimeModule = require("../RuntimeModule");
10
10
  const Template = require("../Template");
11
11
 
12
- class AsyncWasmChunkLoadingRuntimeModule extends RuntimeModule {
12
+ class AsyncWasmLoadingRuntimeModule extends RuntimeModule {
13
13
  constructor({ generateLoadBinaryCode, supportsStreaming }) {
14
- super("wasm chunk loading", RuntimeModule.STAGE_ATTACH);
14
+ super("wasm loading", RuntimeModule.STAGE_NORMAL);
15
15
  this.generateLoadBinaryCode = generateLoadBinaryCode;
16
16
  this.supportsStreaming = supportsStreaming;
17
17
  }
@@ -75,4 +75,4 @@ class AsyncWasmChunkLoadingRuntimeModule extends RuntimeModule {
75
75
  }
76
76
  }
77
77
 
78
- module.exports = AsyncWasmChunkLoadingRuntimeModule;
78
+ module.exports = AsyncWasmLoadingRuntimeModule;
@@ -189,11 +189,17 @@ const generateImportObject = (
189
189
  };
190
190
 
191
191
  class WasmChunkLoadingRuntimeModule extends RuntimeModule {
192
- constructor({ generateLoadBinaryCode, supportsStreaming, mangleImports }) {
192
+ constructor({
193
+ generateLoadBinaryCode,
194
+ supportsStreaming,
195
+ mangleImports,
196
+ runtimeRequirements
197
+ }) {
193
198
  super("wasm chunk loading", RuntimeModule.STAGE_ATTACH);
194
199
  this.generateLoadBinaryCode = generateLoadBinaryCode;
195
200
  this.supportsStreaming = supportsStreaming;
196
201
  this.mangleImports = mangleImports;
202
+ this._runtimeRequirements = runtimeRequirements;
197
203
  }
198
204
 
199
205
  /**
@@ -203,6 +209,9 @@ class WasmChunkLoadingRuntimeModule extends RuntimeModule {
203
209
  const { chunkGraph, compilation, chunk, mangleImports } = this;
204
210
  const { moduleGraph, outputOptions } = compilation;
205
211
  const fn = RuntimeGlobals.ensureChunkHandlers;
212
+ const withHmr = this._runtimeRequirements.has(
213
+ RuntimeGlobals.hmrDownloadUpdateHandlers
214
+ );
206
215
  const wasmModules = getAllWasmModules(moduleGraph, chunkGraph, chunk);
207
216
  const declarations = [];
208
217
  const importObjects = wasmModules.map(module => {
@@ -247,9 +256,16 @@ class WasmChunkLoadingRuntimeModule extends RuntimeModule {
247
256
  runtime: chunk.runtime
248
257
  }
249
258
  );
259
+
260
+ const stateExpression = withHmr
261
+ ? `${RuntimeGlobals.hmrRuntimeStatePrefix}_wasm`
262
+ : undefined;
263
+
250
264
  return Template.asString([
251
265
  "// object to store loaded and loading wasm modules",
252
- "var installedWasmModules = {};",
266
+ `var installedWasmModules = ${
267
+ stateExpression ? `${stateExpression} = ${stateExpression} || ` : ""
268
+ }{};`,
253
269
  "",
254
270
  // This function is used to delay reading the installed wasm module promises
255
271
  // by a microtask. Sorting them doesn't help because there are edge cases where
@@ -6,7 +6,7 @@
6
6
  "use strict";
7
7
 
8
8
  const RuntimeGlobals = require("../RuntimeGlobals");
9
- const AsyncWasmChunkLoadingRuntimeModule = require("../wasm-async/AsyncWasmChunkLoadingRuntimeModule");
9
+ const AsyncWasmLoadingRuntimeModule = require("../wasm-async/AsyncWasmLoadingRuntimeModule");
10
10
 
11
11
  /** @typedef {import("../Compiler")} Compiler */
12
12
 
@@ -48,7 +48,7 @@ class FetchCompileAsyncWasmPlugin {
48
48
  set.add(RuntimeGlobals.publicPath);
49
49
  compilation.addRuntimeModule(
50
50
  chunk,
51
- new AsyncWasmChunkLoadingRuntimeModule({
51
+ new AsyncWasmLoadingRuntimeModule({
52
52
  generateLoadBinaryCode,
53
53
  supportsStreaming: true
54
54
  })
@@ -58,7 +58,8 @@ class FetchCompileWasmPlugin {
58
58
  new WasmChunkLoadingRuntimeModule({
59
59
  generateLoadBinaryCode,
60
60
  supportsStreaming: true,
61
- mangleImports: this.options.mangleImports
61
+ mangleImports: this.options.mangleImports,
62
+ runtimeRequirements: set
62
63
  })
63
64
  );
64
65
  });
@@ -98,6 +98,10 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
98
98
  const hasJsMatcher = compileBooleanMatcher(conditionMap);
99
99
  const initialChunkIds = getInitialChunkIds(chunk, chunkGraph);
100
100
 
101
+ const stateExpression = withHmr
102
+ ? `${RuntimeGlobals.hmrRuntimeStatePrefix}_jsonp`
103
+ : undefined;
104
+
101
105
  return Template.asString([
102
106
  withBaseURI
103
107
  ? Template.asString([
@@ -108,7 +112,9 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
108
112
  "// object to store loaded and loading chunks",
109
113
  "// undefined = chunk not loaded, null = chunk preloaded/prefetched",
110
114
  "// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded",
111
- "var installedChunks = {",
115
+ `var installedChunks = ${
116
+ stateExpression ? `${stateExpression} = ${stateExpression} || ` : ""
117
+ }{`,
112
118
  Template.indent(
113
119
  Array.from(initialChunkIds, id => `${JSON.stringify(id)}: 0`).join(
114
120
  ",\n"
@@ -389,16 +395,23 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
389
395
  '// add "moreModules" to the modules object,',
390
396
  '// then flag all "chunkIds" as loaded and fire callback',
391
397
  "var moduleId, chunkId, i = 0;",
392
- "for(moduleId in moreModules) {",
398
+ `if(chunkIds.some(${runtimeTemplate.returningFunction(
399
+ "installedChunks[id] !== 0",
400
+ "id"
401
+ )})) {`,
393
402
  Template.indent([
394
- `if(${RuntimeGlobals.hasOwnProperty}(moreModules, moduleId)) {`,
395
- Template.indent(
396
- `${RuntimeGlobals.moduleFactories}[moduleId] = moreModules[moduleId];`
397
- ),
398
- "}"
403
+ "for(moduleId in moreModules) {",
404
+ Template.indent([
405
+ `if(${RuntimeGlobals.hasOwnProperty}(moreModules, moduleId)) {`,
406
+ Template.indent(
407
+ `${RuntimeGlobals.moduleFactories}[moduleId] = moreModules[moduleId];`
408
+ ),
409
+ "}"
410
+ ]),
411
+ "}",
412
+ "if(runtime) var result = runtime(__webpack_require__);"
399
413
  ]),
400
414
  "}",
401
- "if(runtime) var result = runtime(__webpack_require__);",
402
415
  "if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);",
403
416
  "for(;i < chunkIds.length; i++) {",
404
417
  Template.indent([
@@ -67,6 +67,10 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {
67
67
  false
68
68
  );
69
69
 
70
+ const stateExpression = withHmr
71
+ ? `${RuntimeGlobals.hmrRuntimeStatePrefix}_importScripts`
72
+ : undefined;
73
+
70
74
  return Template.asString([
71
75
  withBaseURI
72
76
  ? Template.asString([
@@ -78,7 +82,9 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {
78
82
  "",
79
83
  "// object to store loaded chunks",
80
84
  '// "1" means "already loaded"',
81
- "var installedChunks = {",
85
+ `var installedChunks = ${
86
+ stateExpression ? `${stateExpression} = ${stateExpression} || ` : ""
87
+ }{`,
82
88
  Template.indent(
83
89
  Array.from(initialChunkIds, id => `${JSON.stringify(id)}: 1`).join(
84
90
  ",\n"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "5.49.0",
3
+ "version": "5.51.2",
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",
@@ -65,6 +65,7 @@
65
65
  "is-ci": "^3.0.0",
66
66
  "istanbul": "^0.4.5",
67
67
  "jest": "^27.0.6",
68
+ "jest-cli": "^27.0.6",
68
69
  "jest-circus": "^27.0.6",
69
70
  "jest-diff": "^27.0.2",
70
71
  "jest-junit": "^12.0.0",
@@ -1213,7 +1213,7 @@
1213
1213
  ]
1214
1214
  },
1215
1215
  "frozen": {
1216
- "description": "When set, anything that would lead to an modification of the lockfile or any resource content, will result in an error.",
1216
+ "description": "When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.",
1217
1217
  "type": "boolean"
1218
1218
  },
1219
1219
  "lockfileLocation": {
@@ -18,7 +18,7 @@
18
18
  ]
19
19
  },
20
20
  "frozen": {
21
- "description": "When set, anything that would lead to an modification of the lockfile or any resource content, will result in an error.",
21
+ "description": "When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.",
22
22
  "type": "boolean"
23
23
  },
24
24
  "lockfileLocation": {
package/types.d.ts CHANGED
@@ -767,6 +767,10 @@ declare class ChunkGraph {
767
767
  attachModules(chunk: Chunk, modules: Iterable<Module>): void;
768
768
  attachRuntimeModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
769
769
  attachFullHashModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
770
+ attachDependentHashModules(
771
+ chunk: Chunk,
772
+ modules: Iterable<RuntimeModule>
773
+ ): void;
770
774
  replaceModule(oldModule: Module, newModule: Module): void;
771
775
  isModuleInChunk(module: Module, chunk: Chunk): boolean;
772
776
  isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
@@ -780,6 +784,7 @@ declare class ChunkGraph {
780
784
  getNumberOfModuleChunks(module: Module): number;
781
785
  getModuleRuntimes(module: Module): RuntimeSpecSet;
782
786
  getNumberOfChunkModules(chunk: Chunk): number;
787
+ getNumberOfChunkFullHashModules(chunk: Chunk): number;
783
788
  getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
784
789
  getChunkModulesIterableBySourceType(
785
790
  chunk: Chunk,
@@ -831,6 +836,7 @@ declare class ChunkGraph {
831
836
  ): number;
832
837
  canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
833
838
  integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
839
+ upgradeDependentToFullHashModules(chunk: Chunk): void;
834
840
  isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
835
841
  connectChunkAndEntryModule(
836
842
  chunk: Chunk,
@@ -839,6 +845,7 @@ declare class ChunkGraph {
839
845
  ): void;
840
846
  connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
841
847
  addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
848
+ addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
842
849
  disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
843
850
  disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
844
851
  disconnectEntryModule(module: Module): void;
@@ -856,6 +863,9 @@ declare class ChunkGraph {
856
863
  getChunkFullHashModulesSet(
857
864
  chunk: Chunk
858
865
  ): undefined | ReadonlySet<RuntimeModule>;
866
+ getChunkDependentHashModulesIterable(
867
+ chunk: Chunk
868
+ ): undefined | Iterable<RuntimeModule>;
859
869
  getChunkEntryModulesWithChunkGroupIterable(
860
870
  chunk: Chunk
861
871
  ): Iterable<[Module, undefined | Entrypoint]>;
@@ -2388,6 +2398,17 @@ declare class ContextExclusionPlugin {
2388
2398
  */
2389
2399
  apply(compiler: Compiler): void;
2390
2400
  }
2401
+ declare interface ContextFileSystemInfoEntry {
2402
+ safeTime: number;
2403
+ timestampHash?: string;
2404
+ resolved?: ResolvedContextFileSystemInfoEntry;
2405
+ symlinks?: Set<string>;
2406
+ }
2407
+ declare interface ContextHash {
2408
+ hash: string;
2409
+ resolved?: string;
2410
+ symlinks?: Set<string>;
2411
+ }
2391
2412
  type ContextMode =
2392
2413
  | "sync"
2393
2414
  | "eager"
@@ -2455,6 +2476,13 @@ declare class ContextReplacementPlugin {
2455
2476
  newContentRegExp: any;
2456
2477
  apply(compiler?: any): void;
2457
2478
  }
2479
+ declare interface ContextTimestampAndHash {
2480
+ safeTime: number;
2481
+ timestampHash?: string;
2482
+ hash: string;
2483
+ resolved?: ResolvedContextTimestampAndHash;
2484
+ symlinks?: Set<string>;
2485
+ }
2458
2486
  type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
2459
2487
  Record<string, any>;
2460
2488
  type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
@@ -3968,8 +3996,13 @@ declare abstract class FileSystemInfo {
3968
3996
  logger?: WebpackLogger;
3969
3997
  fileTimestampQueue: AsyncQueue<string, string, null | FileSystemInfoEntry>;
3970
3998
  fileHashQueue: AsyncQueue<string, string, null | string>;
3971
- contextTimestampQueue: AsyncQueue<string, string, null | FileSystemInfoEntry>;
3972
- contextHashQueue: AsyncQueue<string, string, null | string>;
3999
+ contextTimestampQueue: AsyncQueue<
4000
+ string,
4001
+ string,
4002
+ null | ContextFileSystemInfoEntry
4003
+ >;
4004
+ contextHashQueue: AsyncQueue<string, string, null | ContextHash>;
4005
+ contextTshQueue: AsyncQueue<string, string, null | ContextTimestampAndHash>;
3973
4006
  managedItemQueue: AsyncQueue<string, string, null | string>;
3974
4007
  managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
3975
4008
  managedPaths: string[];
@@ -3997,7 +4030,7 @@ declare abstract class FileSystemInfo {
3997
4030
  path: string,
3998
4031
  callback: (
3999
4032
  arg0?: WebpackError,
4000
- arg1?: null | FileSystemInfoEntry | "ignore"
4033
+ arg1?: null | "ignore" | ResolvedContextFileSystemInfoEntry
4001
4034
  ) => void
4002
4035
  ): void;
4003
4036
  getFileHash(
@@ -4008,6 +4041,13 @@ declare abstract class FileSystemInfo {
4008
4041
  path: string,
4009
4042
  callback: (arg0?: WebpackError, arg1?: string) => void
4010
4043
  ): void;
4044
+ getContextTsh(
4045
+ path: string,
4046
+ callback: (
4047
+ arg0?: WebpackError,
4048
+ arg1?: ResolvedContextTimestampAndHash
4049
+ ) => void
4050
+ ): void;
4011
4051
  resolveBuildDependencies(
4012
4052
  context: string,
4013
4053
  deps: Iterable<string>,
@@ -4045,7 +4085,6 @@ declare abstract class FileSystemInfo {
4045
4085
  declare interface FileSystemInfoEntry {
4046
4086
  safeTime: number;
4047
4087
  timestamp?: number;
4048
- timestampHash?: string;
4049
4088
  }
4050
4089
  declare interface FileSystemStats {
4051
4090
  isDirectory: () => boolean;
@@ -4301,7 +4340,7 @@ declare interface HttpUriOptions {
4301
4340
  cacheLocation?: string | false;
4302
4341
 
4303
4342
  /**
4304
- * When set, anything that would lead to an modification of the lockfile or any resource content, will result in an error.
4343
+ * When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
4305
4344
  */
4306
4345
  frozen?: boolean;
4307
4346
 
@@ -4322,7 +4361,7 @@ declare class HttpUriPlugin {
4322
4361
  */
4323
4362
  cacheLocation?: string | false;
4324
4363
  /**
4325
- * When set, anything that would lead to an modification of the lockfile or any resource content, will result in an error.
4364
+ * When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
4326
4365
  */
4327
4366
  frozen?: boolean;
4328
4367
  /**
@@ -4504,6 +4543,10 @@ declare interface InputFileSystem {
4504
4543
  arg0: string,
4505
4544
  arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
4506
4545
  ) => void;
4546
+ lstat?: (
4547
+ arg0: string,
4548
+ arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
4549
+ ) => void;
4507
4550
  realpath?: (
4508
4551
  arg0: string,
4509
4552
  arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
@@ -8470,6 +8513,7 @@ declare interface ParserOptionsByModuleTypeUnknown {
8470
8513
  }
8471
8514
  type ParserState = Record<string, any> & ParserStateBase;
8472
8515
  declare interface ParserStateBase {
8516
+ source: string | Buffer;
8473
8517
  current: NormalModule;
8474
8518
  module: NormalModule;
8475
8519
  compilation: Compilation;
@@ -9254,6 +9298,15 @@ declare interface ResolvePluginInstance {
9254
9298
  apply: (resolver: Resolver) => void;
9255
9299
  }
9256
9300
  type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
9301
+ declare interface ResolvedContextFileSystemInfoEntry {
9302
+ safeTime: number;
9303
+ timestampHash?: string;
9304
+ }
9305
+ declare interface ResolvedContextTimestampAndHash {
9306
+ safeTime: number;
9307
+ timestampHash?: string;
9308
+ hash: string;
9309
+ }
9257
9310
  declare abstract class Resolver {
9258
9311
  fileSystem: FileSystem;
9259
9312
  options: ResolveOptionsTypes;
@@ -9736,6 +9789,7 @@ declare class RuntimeModule extends Module {
9736
9789
  chunk: Chunk;
9737
9790
  chunkGraph: ChunkGraph;
9738
9791
  fullHash: boolean;
9792
+ dependentHash: boolean;
9739
9793
  attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
9740
9794
  generate(): string;
9741
9795
  getGeneratedCode(): string;
@@ -10325,9 +10379,9 @@ declare abstract class Snapshot {
10325
10379
  fileTimestamps?: Map<string, FileSystemInfoEntry>;
10326
10380
  fileHashes?: Map<string, string>;
10327
10381
  fileTshs?: Map<string, string | TimestampAndHash>;
10328
- contextTimestamps?: Map<string, FileSystemInfoEntry>;
10382
+ contextTimestamps?: Map<string, ResolvedContextFileSystemInfoEntry>;
10329
10383
  contextHashes?: Map<string, string>;
10330
- contextTshs?: Map<string, string | TimestampAndHash>;
10384
+ contextTshs?: Map<string, ResolvedContextTimestampAndHash>;
10331
10385
  missingExistence?: Map<string, boolean>;
10332
10386
  managedItemInfo?: Map<string, string>;
10333
10387
  managedFiles?: Set<string>;
@@ -11241,7 +11295,6 @@ declare class Template {
11241
11295
  declare interface TimestampAndHash {
11242
11296
  safeTime: number;
11243
11297
  timestamp?: number;
11244
- timestampHash?: string;
11245
11298
  hash: string;
11246
11299
  }
11247
11300
 
@@ -12035,6 +12088,7 @@ declare namespace exports {
12035
12088
  export let hmrDownloadUpdateHandlers: string;
12036
12089
  export let hmrModuleData: string;
12037
12090
  export let hmrInvalidateModuleHandlers: string;
12091
+ export let hmrRuntimeStatePrefix: string;
12038
12092
  export let amdDefine: string;
12039
12093
  export let amdOptions: string;
12040
12094
  export let system: string;