webpack 5.23.0 → 5.24.3

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.

package/types.d.ts CHANGED
@@ -232,6 +232,10 @@ declare interface AssetEmittedInfo {
232
232
  outputPath: string;
233
233
  targetPath: string;
234
234
  }
235
+ type AssetFilterItemTypes =
236
+ | string
237
+ | RegExp
238
+ | ((name: string, asset: StatsAsset) => boolean);
235
239
 
236
240
  /**
237
241
  * Options object for data url generation.
@@ -3128,6 +3132,7 @@ declare abstract class ExportInfo {
3128
3132
  runtime: RuntimeSpec
3129
3133
  ): boolean;
3130
3134
  setUsed(newValue: UsageStateType, runtime: RuntimeSpec): boolean;
3135
+ unsetTarget(key?: any): boolean;
3131
3136
  setTarget(
3132
3137
  key?: any,
3133
3138
  connection?: ModuleGraphConnection,
@@ -3176,7 +3181,11 @@ declare abstract class ExportInfo {
3176
3181
  resolveTargetFilter: (arg0: {
3177
3182
  module: Module;
3178
3183
  export?: string[];
3179
- }) => boolean
3184
+ }) => boolean,
3185
+ updateOriginalConnection?: (arg0: {
3186
+ module: Module;
3187
+ export?: string[];
3188
+ }) => ModuleGraphConnection
3180
3189
  ): undefined | { module: Module; export?: string[] };
3181
3190
  createNestedExportsInfo(): undefined | ExportsInfo;
3182
3191
  getNestedExportsInfo(): undefined | ExportsInfo;
@@ -3230,6 +3239,11 @@ declare interface ExportSpec {
3230
3239
  * when reexported: from which export
3231
3240
  */
3232
3241
  export?: null | string[];
3242
+
3243
+ /**
3244
+ * export is not visible, because another export blends over it
3245
+ */
3246
+ hidden?: boolean;
3233
3247
  }
3234
3248
  type ExportedVariableInfo = string | ScopeInfo | VariableInfo;
3235
3249
  declare abstract class ExportsInfo {
@@ -3289,6 +3303,11 @@ declare interface ExportsSpec {
3289
3303
  */
3290
3304
  excludeExports?: Set<string>;
3291
3305
 
3306
+ /**
3307
+ * list of maybe prior exposed, but now hidden exports
3308
+ */
3309
+ hideExports?: Set<string>;
3310
+
3292
3311
  /**
3293
3312
  * when reexported: from which module
3294
3313
  */
@@ -5051,9 +5070,13 @@ declare interface KnownNormalizedStatsOptions {
5051
5070
  groupAssetsByPath: boolean;
5052
5071
  groupAssetsByExtension: boolean;
5053
5072
  assetsSpace: number;
5054
- excludeAssets: Function[];
5055
- excludeModules: Function[];
5056
- warningsFilter: Function[];
5073
+ excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
5074
+ excludeModules: ((
5075
+ name: string,
5076
+ module: StatsModule,
5077
+ type: "module" | "chunk" | "root-of-chunk" | "nested"
5078
+ ) => boolean)[];
5079
+ warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
5057
5080
  cachedModules: boolean;
5058
5081
  orphanModules: boolean;
5059
5082
  dependentModules: boolean;
@@ -5073,7 +5096,7 @@ declare interface KnownNormalizedStatsOptions {
5073
5096
  chunkModulesSpace: number;
5074
5097
  nestedModulesSpace: number;
5075
5098
  logging: false | "none" | "verbose" | "error" | "warn" | "info" | "log";
5076
- loggingDebug: Function[];
5099
+ loggingDebug: ((value: string) => boolean)[];
5077
5100
  loggingTrace: boolean;
5078
5101
  }
5079
5102
  declare interface KnownStatsAsset {
@@ -5910,6 +5933,14 @@ declare interface ModuleFederationPluginOptions {
5910
5933
  */
5911
5934
  shared?: (string | SharedObject)[] | SharedObject;
5912
5935
  }
5936
+ type ModuleFilterItemTypes =
5937
+ | string
5938
+ | RegExp
5939
+ | ((
5940
+ name: string,
5941
+ module: StatsModule,
5942
+ type: "module" | "chunk" | "root-of-chunk" | "nested"
5943
+ ) => boolean);
5913
5944
  declare class ModuleGraph {
5914
5945
  constructor();
5915
5946
  setParents(
@@ -5948,6 +5979,9 @@ declare class ModuleGraph {
5948
5979
  getResolvedOrigin(dependency: Dependency): Module;
5949
5980
  getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
5950
5981
  getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
5982
+ getIncomingConnectionsByOriginModule(
5983
+ module: Module
5984
+ ): Map<Module, ReadonlyArray<ModuleGraphConnection>>;
5951
5985
  getProfile(module: Module): null | ModuleProfile;
5952
5986
  setProfile(module: Module, profile: null | ModuleProfile): void;
5953
5987
  getIssuer(module: Module): null | Module;
@@ -5994,8 +6028,8 @@ declare class ModuleGraph {
5994
6028
  }
5995
6029
  declare class ModuleGraphConnection {
5996
6030
  constructor(
5997
- originModule: undefined | Module,
5998
- dependency: undefined | Dependency,
6031
+ originModule: null | Module,
6032
+ dependency: null | Dependency,
5999
6033
  module: Module,
6000
6034
  explanation?: string,
6001
6035
  weak?: boolean,
@@ -6003,9 +6037,9 @@ declare class ModuleGraphConnection {
6003
6037
  | false
6004
6038
  | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState)
6005
6039
  );
6006
- originModule?: Module;
6007
- resolvedOriginModule?: Module;
6008
- dependency?: Dependency;
6040
+ originModule: null | Module;
6041
+ resolvedOriginModule: null | Module;
6042
+ dependency: null | Dependency;
6009
6043
  resolvedModule: Module;
6010
6044
  module: Module;
6011
6045
  weak: boolean;
@@ -6636,7 +6670,47 @@ declare class NormalModuleReplacementPlugin {
6636
6670
  apply(compiler: Compiler): void;
6637
6671
  }
6638
6672
  type NormalizedStatsOptions = KnownNormalizedStatsOptions &
6639
- StatsOptions &
6673
+ Omit<
6674
+ StatsOptions,
6675
+ | "context"
6676
+ | "requestShortener"
6677
+ | "chunkGroups"
6678
+ | "chunksSort"
6679
+ | "modulesSort"
6680
+ | "chunkModulesSort"
6681
+ | "nestedModulesSort"
6682
+ | "assetsSort"
6683
+ | "ids"
6684
+ | "cachedAssets"
6685
+ | "groupAssetsByEmitStatus"
6686
+ | "groupAssetsByPath"
6687
+ | "groupAssetsByExtension"
6688
+ | "assetsSpace"
6689
+ | "excludeAssets"
6690
+ | "excludeModules"
6691
+ | "warningsFilter"
6692
+ | "cachedModules"
6693
+ | "orphanModules"
6694
+ | "dependentModules"
6695
+ | "runtimeModules"
6696
+ | "groupModulesByCacheStatus"
6697
+ | "groupModulesByLayer"
6698
+ | "groupModulesByAttributes"
6699
+ | "groupModulesByPath"
6700
+ | "groupModulesByExtension"
6701
+ | "groupModulesByType"
6702
+ | "entrypoints"
6703
+ | "chunkGroupAuxiliary"
6704
+ | "chunkGroupChildren"
6705
+ | "chunkGroupMaxAssets"
6706
+ | "modulesSpace"
6707
+ | "chunkModulesSpace"
6708
+ | "nestedModulesSpace"
6709
+ | "logging"
6710
+ | "loggingDebug"
6711
+ | "loggingTrace"
6712
+ | "_env"
6713
+ > &
6640
6714
  Record<string, any>;
6641
6715
  declare interface ObjectDeserializerContext {
6642
6716
  read: () => any;
@@ -6830,7 +6904,7 @@ declare interface OptimizationSplitChunksCacheGroup {
6830
6904
  /**
6831
6905
  * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
6832
6906
  */
6833
- chunks?: "initial" | "async" | "all" | ((chunk: Chunk) => boolean);
6907
+ chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
6834
6908
 
6835
6909
  /**
6836
6910
  * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
@@ -6952,7 +7026,7 @@ declare interface OptimizationSplitChunksOptions {
6952
7026
  /**
6953
7027
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
6954
7028
  */
6955
- chunks?: "initial" | "async" | "all" | ((chunk: Chunk) => boolean);
7029
+ chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
6956
7030
 
6957
7031
  /**
6958
7032
  * Sets the size types which are used when a number is used for sizes.
@@ -10155,8 +10229,12 @@ declare interface StatsOptions {
10155
10229
  | string
10156
10230
  | boolean
10157
10231
  | RegExp
10158
- | FilterItemTypes[]
10159
- | ((value: string) => boolean);
10232
+ | ModuleFilterItemTypes[]
10233
+ | ((
10234
+ name: string,
10235
+ module: StatsModule,
10236
+ type: "module" | "chunk" | "root-of-chunk" | "nested"
10237
+ ) => boolean);
10160
10238
 
10161
10239
  /**
10162
10240
  * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
@@ -10164,8 +10242,8 @@ declare interface StatsOptions {
10164
10242
  excludeAssets?:
10165
10243
  | string
10166
10244
  | RegExp
10167
- | FilterItemTypes[]
10168
- | ((value: string) => boolean);
10245
+ | AssetFilterItemTypes[]
10246
+ | ((name: string, asset: StatsAsset) => boolean);
10169
10247
 
10170
10248
  /**
10171
10249
  * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
@@ -10174,8 +10252,12 @@ declare interface StatsOptions {
10174
10252
  | string
10175
10253
  | boolean
10176
10254
  | RegExp
10177
- | FilterItemTypes[]
10178
- | ((value: string) => boolean);
10255
+ | ModuleFilterItemTypes[]
10256
+ | ((
10257
+ name: string,
10258
+ module: StatsModule,
10259
+ type: "module" | "chunk" | "root-of-chunk" | "nested"
10260
+ ) => boolean);
10179
10261
 
10180
10262
  /**
10181
10263
  * Group assets by how their are related to chunks.
@@ -10383,8 +10465,8 @@ declare interface StatsOptions {
10383
10465
  warningsFilter?:
10384
10466
  | string
10385
10467
  | RegExp
10386
- | FilterItemTypes[]
10387
- | ((value: string) => boolean);
10468
+ | WarningFilterItemTypes[]
10469
+ | ((warning: StatsError, value: string) => boolean);
10388
10470
  }
10389
10471
  declare abstract class StatsPrinter {
10390
10472
  hooks: Readonly<{
@@ -10627,6 +10709,10 @@ declare interface VariableInfoInterface {
10627
10709
  freeName: string | true;
10628
10710
  tagInfo?: TagInfo;
10629
10711
  }
10712
+ type WarningFilterItemTypes =
10713
+ | string
10714
+ | RegExp
10715
+ | ((warning: StatsError, value: string) => boolean);
10630
10716
  declare interface WatchFileSystem {
10631
10717
  watch: (
10632
10718
  files: Iterable<string>,
@@ -10700,6 +10786,16 @@ declare interface Watcher {
10700
10786
  */
10701
10787
  pause: () => void;
10702
10788
 
10789
+ /**
10790
+ * get current aggregated changes that have not yet send to callback
10791
+ */
10792
+ getAggregatedChanges?: () => Set<string>;
10793
+
10794
+ /**
10795
+ * get current aggregated removals that have not yet send to callback
10796
+ */
10797
+ getAggregatedRemovals?: () => Set<string>;
10798
+
10703
10799
  /**
10704
10800
  * get info about files
10705
10801
  */
@@ -11485,6 +11581,7 @@ declare namespace exports {
11485
11581
  AssetInfo,
11486
11582
  MultiStats,
11487
11583
  ParserState,
11584
+ Watching,
11488
11585
  StatsCompilation
11489
11586
  };
11490
11587
  }