webpack 5.51.1 → 5.53.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.

@@ -699,8 +699,8 @@
699
699
  }
700
700
  ]
701
701
  },
702
- "executeModule": {
703
- "description": "Enable build-time execution of modules from the module graph for plugins and loaders.",
702
+ "futureDefaults": {
703
+ "description": "Apply defaults of next major version.",
704
704
  "type": "boolean"
705
705
  },
706
706
  "layers": {
@@ -1944,15 +1944,15 @@
1944
1944
  "properties": {
1945
1945
  "__dirname": {
1946
1946
  "description": "Include a polyfill for the '__dirname' variable.",
1947
- "enum": [false, true, "mock", "eval-only"]
1947
+ "enum": [false, true, "warn-mock", "mock", "eval-only"]
1948
1948
  },
1949
1949
  "__filename": {
1950
1950
  "description": "Include a polyfill for the '__filename' variable.",
1951
- "enum": [false, true, "mock", "eval-only"]
1951
+ "enum": [false, true, "warn-mock", "mock", "eval-only"]
1952
1952
  },
1953
1953
  "global": {
1954
1954
  "description": "Include a polyfill for the 'global' variable.",
1955
- "type": "boolean"
1955
+ "enum": [false, true, "warn"]
1956
1956
  }
1957
1957
  }
1958
1958
  },
@@ -3,4 +3,4 @@
3
3
  * DO NOT MODIFY BY HAND.
4
4
  * Run `yarn special-lint-fix` to update
5
5
  */
6
- "use strict";function e(t,{instancePath:o="",parentData:s,parentDataProperty:r,rootData:n=t}={}){let c=null,a=0;const p=a;let l=!1;const i=a;if(a===i)if(t&&"object"==typeof t&&!Array.isArray(t)){const e=a;for(const e in t)if("contextRegExp"!==e&&"resourceRegExp"!==e){const t={params:{additionalProperty:e}};null===c?c=[t]:c.push(t),a++;break}if(e===a){if(void 0!==t.contextRegExp){const e=a;if(!(t.contextRegExp instanceof RegExp)){const e={params:{}};null===c?c=[e]:c.push(e),a++}var u=e===a}else u=!0;if(u)if(void 0!==t.resourceRegExp){const e=a;if(!(t.resourceRegExp instanceof RegExp)){const e={params:{}};null===c?c=[e]:c.push(e),a++}u=e===a}else u=!0}}else{const e={params:{type:"object"}};null===c?c=[e]:c.push(e),a++}var f=i===a;if(l=l||f,!l){const e=a;if(a===e)if(t&&"object"==typeof t&&!Array.isArray(t)){const e=a;for(const e in t)if("checkResource"!==e){const t={params:{additionalProperty:e}};null===c?c=[t]:c.push(t),a++;break}if(e===a&&void 0!==t.checkResource&&!(t.checkResource instanceof Function)){const e={params:{}};null===c?c=[e]:c.push(e),a++}}else{const e={params:{type:"object"}};null===c?c=[e]:c.push(e),a++}f=e===a,l=l||f}if(!l){const t={params:{}};return null===c?c=[t]:c.push(t),a++,e.errors=c,!1}return a=p,null!==c&&(p?c.length=p:c=null),e.errors=c,0===a}module.exports=e,module.exports.default=e;
6
+ "use strict";function e(s,{instancePath:o="",parentData:r,parentDataProperty:t,rootData:n=s}={}){let c=null,a=0;const p=a;let l=!1;const i=a;if(a===i)if(s&&"object"==typeof s&&!Array.isArray(s)){let e;if(void 0===s.resourceRegExp&&(e="resourceRegExp")){const s={params:{missingProperty:e}};null===c?c=[s]:c.push(s),a++}else{const e=a;for(const e in s)if("contextRegExp"!==e&&"resourceRegExp"!==e){const s={params:{additionalProperty:e}};null===c?c=[s]:c.push(s),a++;break}if(e===a){if(void 0!==s.contextRegExp){const e=a;if(!(s.contextRegExp instanceof RegExp)){const e={params:{}};null===c?c=[e]:c.push(e),a++}var u=e===a}else u=!0;if(u)if(void 0!==s.resourceRegExp){const e=a;if(!(s.resourceRegExp instanceof RegExp)){const e={params:{}};null===c?c=[e]:c.push(e),a++}u=e===a}else u=!0}}}else{const e={params:{type:"object"}};null===c?c=[e]:c.push(e),a++}var f=i===a;if(l=l||f,!l){const e=a;if(a===e)if(s&&"object"==typeof s&&!Array.isArray(s)){let e;if(void 0===s.checkResource&&(e="checkResource")){const s={params:{missingProperty:e}};null===c?c=[s]:c.push(s),a++}else{const e=a;for(const e in s)if("checkResource"!==e){const s={params:{additionalProperty:e}};null===c?c=[s]:c.push(s),a++;break}if(e===a&&void 0!==s.checkResource&&!(s.checkResource instanceof Function)){const e={params:{}};null===c?c=[e]:c.push(e),a++}}}else{const e={params:{type:"object"}};null===c?c=[e]:c.push(e),a++}f=e===a,l=l||f}if(!l){const s={params:{}};return null===c?c=[s]:c.push(s),a++,e.errors=c,!1}return a=p,null!==c&&(p?c.length=p:c=null),e.errors=c,0===a}module.exports=e,module.exports.default=e;
@@ -15,7 +15,8 @@
15
15
  "instanceof": "RegExp",
16
16
  "tsType": "RegExp"
17
17
  }
18
- }
18
+ },
19
+ "required": ["resourceRegExp"]
19
20
  },
20
21
  {
21
22
  "type": "object",
@@ -26,7 +27,8 @@
26
27
  "instanceof": "Function",
27
28
  "tsType": "((resource: string, context: string) => boolean)"
28
29
  }
29
- }
30
+ },
31
+ "required": ["checkResource"]
30
32
  }
31
33
  ]
32
34
  }
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]>;
@@ -3273,9 +3283,9 @@ declare interface Experiments {
3273
3283
  buildHttp?: boolean | HttpUriOptions;
3274
3284
 
3275
3285
  /**
3276
- * Enable build-time execution of modules from the module graph for plugins and loaders.
3286
+ * Apply defaults of next major version.
3277
3287
  */
3278
- executeModule?: boolean;
3288
+ futureDefaults?: boolean;
3279
3289
 
3280
3290
  /**
3281
3291
  * Enable module and chunk layers.
@@ -4433,13 +4443,13 @@ type IgnorePluginOptions =
4433
4443
  /**
4434
4444
  * A RegExp to test the request against.
4435
4445
  */
4436
- resourceRegExp?: RegExp;
4446
+ resourceRegExp: RegExp;
4437
4447
  }
4438
4448
  | {
4439
4449
  /**
4440
4450
  * A filter function for resource and context.
4441
4451
  */
4442
- checkResource?: (resource: string, context: string) => boolean;
4452
+ checkResource: (resource: string, context: string) => boolean;
4443
4453
  };
4444
4454
  declare interface ImportModuleOptions {
4445
4455
  /**
@@ -4507,6 +4517,8 @@ declare abstract class InitFragment<Context> {
4507
4517
  endContent?: string | Source;
4508
4518
  getContent(context: Context): string | Source;
4509
4519
  getEndContent(context: Context): undefined | string | Source;
4520
+ serialize(context?: any): void;
4521
+ deserialize(context?: any): void;
4510
4522
  merge: any;
4511
4523
  }
4512
4524
  declare interface InputFileSystem {
@@ -7149,17 +7161,17 @@ declare interface NodeOptions {
7149
7161
  /**
7150
7162
  * Include a polyfill for the '__dirname' variable.
7151
7163
  */
7152
- __dirname?: boolean | "mock" | "eval-only";
7164
+ __dirname?: boolean | "warn-mock" | "mock" | "eval-only";
7153
7165
 
7154
7166
  /**
7155
7167
  * Include a polyfill for the '__filename' variable.
7156
7168
  */
7157
- __filename?: boolean | "mock" | "eval-only";
7169
+ __filename?: boolean | "warn-mock" | "mock" | "eval-only";
7158
7170
 
7159
7171
  /**
7160
7172
  * Include a polyfill for the 'global' variable.
7161
7173
  */
7162
- global?: boolean;
7174
+ global?: boolean | "warn";
7163
7175
  }
7164
7176
  declare class NodeSourcePlugin {
7165
7177
  constructor();
@@ -9779,6 +9791,7 @@ declare class RuntimeModule extends Module {
9779
9791
  chunk: Chunk;
9780
9792
  chunkGraph: ChunkGraph;
9781
9793
  fullHash: boolean;
9794
+ dependentHash: boolean;
9782
9795
  attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
9783
9796
  generate(): string;
9784
9797
  getGeneratedCode(): string;