webpack 5.59.1 → 5.60.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.

@@ -1615,20 +1615,86 @@
1615
1615
  }
1616
1616
  ]
1617
1617
  },
1618
- "LazyCompilationOptions": {
1619
- "description": "Options for compiling entrypoints and import()s only when they are accessed.",
1618
+ "LazyCompilationDefaultBackendOptions": {
1619
+ "description": "Options for the default backend.",
1620
1620
  "type": "object",
1621
1621
  "additionalProperties": false,
1622
1622
  "properties": {
1623
- "backend": {
1624
- "description": "A custom backend.",
1625
- "instanceof": "Function",
1626
- "tsType": "(((compiler: import('../lib/Compiler'), client: string, callback: (err?: Error, api?: any) => void) => void) | ((compiler: import('../lib/Compiler'), client: string) => Promise<any>))"
1627
- },
1628
1623
  "client": {
1629
1624
  "description": "A custom client.",
1630
1625
  "type": "string"
1631
1626
  },
1627
+ "listen": {
1628
+ "description": "Specifies where to listen to from the server.",
1629
+ "anyOf": [
1630
+ {
1631
+ "description": "A port.",
1632
+ "type": "number"
1633
+ },
1634
+ {
1635
+ "description": "Listen options.",
1636
+ "type": "object",
1637
+ "additionalProperties": true,
1638
+ "properties": {
1639
+ "host": {
1640
+ "description": "A host.",
1641
+ "type": "number"
1642
+ },
1643
+ "port": {
1644
+ "description": "A port.",
1645
+ "type": "number"
1646
+ }
1647
+ },
1648
+ "tsType": "import(\"net\").ListenOptions"
1649
+ },
1650
+ {
1651
+ "description": "A custom listen function.",
1652
+ "instanceof": "Function",
1653
+ "tsType": "((server: import(\"net\").Server) => void)"
1654
+ }
1655
+ ]
1656
+ },
1657
+ "protocol": {
1658
+ "description": "Specifies the protocol the client should use to connect to the server.",
1659
+ "enum": ["http", "https"]
1660
+ },
1661
+ "server": {
1662
+ "description": "Specifies how to create the server handling the EventSource requests.",
1663
+ "anyOf": [
1664
+ {
1665
+ "description": "ServerOptions for the http or https createServer call.",
1666
+ "type": "object",
1667
+ "additionalProperties": true,
1668
+ "properties": {},
1669
+ "tsType": "(import(\"https\").ServerOptions | import(\"http\").ServerOptions)"
1670
+ },
1671
+ {
1672
+ "description": "A custom create server function.",
1673
+ "instanceof": "Function",
1674
+ "tsType": "(() => import(\"net\").Server)"
1675
+ }
1676
+ ]
1677
+ }
1678
+ }
1679
+ },
1680
+ "LazyCompilationOptions": {
1681
+ "description": "Options for compiling entrypoints and import()s only when they are accessed.",
1682
+ "type": "object",
1683
+ "additionalProperties": false,
1684
+ "properties": {
1685
+ "backend": {
1686
+ "description": "Specifies the backend that should be used for handling client keep alive.",
1687
+ "anyOf": [
1688
+ {
1689
+ "description": "A custom backend.",
1690
+ "instanceof": "Function",
1691
+ "tsType": "(((compiler: import('../lib/Compiler'), callback: (err?: Error, api?: import(\"../lib/hmr/LazyCompilationPlugin\").BackendApi) => void) => void) | ((compiler: import('../lib/Compiler')) => Promise<import(\"../lib/hmr/LazyCompilationPlugin\").BackendApi>))"
1692
+ },
1693
+ {
1694
+ "$ref": "#/definitions/LazyCompilationDefaultBackendOptions"
1695
+ }
1696
+ ]
1697
+ },
1632
1698
  "entries": {
1633
1699
  "description": "Enable/disable lazy compilation for entries.",
1634
1700
  "type": "boolean"
package/types.d.ts CHANGED
@@ -80,6 +80,8 @@ import {
80
80
  WithStatement,
81
81
  YieldExpression
82
82
  } from "estree";
83
+ import { ServerOptions as ServerOptionsImport } from "http";
84
+ import { ListenOptions, Server } from "net";
83
85
  import { validate as validateFunction } from "schema-utils";
84
86
  import { default as ValidationError } from "schema-utils/declarations/ValidationError";
85
87
  import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
@@ -95,6 +97,7 @@ import {
95
97
  SyncHook,
96
98
  SyncWaterfallHook
97
99
  } from "tapable";
100
+ import { SecureContextOptions, TlsOptions } from "tls";
98
101
 
99
102
  declare class AbstractLibraryPlugin<T> {
100
103
  constructor(__0: {
@@ -383,6 +386,10 @@ declare class AutomaticPrefetchPlugin {
383
386
  apply(compiler: Compiler): void;
384
387
  }
385
388
  type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
389
+ declare interface BackendApi {
390
+ dispose: (arg0?: Error) => void;
391
+ module: (arg0: Module) => { client: string; data: string; active: boolean };
392
+ }
386
393
  declare class BannerPlugin {
387
394
  constructor(options: BannerPluginArgument);
388
395
  options: BannerPluginOptions;
@@ -5794,25 +5801,45 @@ declare interface KnownStatsProfile {
5794
5801
  dependencies: number;
5795
5802
  }
5796
5803
 
5804
+ /**
5805
+ * Options for the default backend.
5806
+ */
5807
+ declare interface LazyCompilationDefaultBackendOptions {
5808
+ /**
5809
+ * A custom client.
5810
+ */
5811
+ client?: string;
5812
+
5813
+ /**
5814
+ * Specifies where to listen to from the server.
5815
+ */
5816
+ listen?: number | ListenOptions | ((server: typeof Server) => void);
5817
+
5818
+ /**
5819
+ * Specifies the protocol the client should use to connect to the server.
5820
+ */
5821
+ protocol?: "http" | "https";
5822
+
5823
+ /**
5824
+ * Specifies how to create the server handling the EventSource requests.
5825
+ */
5826
+ server?: ServerOptionsImport | ServerOptionsHttps | (() => typeof Server);
5827
+ }
5828
+
5797
5829
  /**
5798
5830
  * Options for compiling entrypoints and import()s only when they are accessed.
5799
5831
  */
5800
5832
  declare interface LazyCompilationOptions {
5801
5833
  /**
5802
- * A custom backend.
5834
+ * Specifies the backend that should be used for handling client keep alive.
5803
5835
  */
5804
5836
  backend?:
5805
5837
  | ((
5806
5838
  compiler: Compiler,
5807
- client: string,
5808
- callback: (err?: Error, api?: any) => void
5839
+ callback: (err?: Error, api?: BackendApi) => void
5809
5840
  ) => void)
5810
- | ((compiler: Compiler, client: string) => Promise<any>);
5811
-
5812
- /**
5813
- * A custom client.
5814
- */
5815
- client?: string;
5841
+ | ((compiler: Compiler) => Promise<BackendApi>)
5842
+ | LazyCompilationDefaultBackendOptions;
5816
5843
 
5817
5844
  /**
5818
5845
  * Enable/disable lazy compilation for entries.
@@ -10369,6 +10396,9 @@ declare abstract class Serializer {
10369
10396
  serialize(obj?: any, context?: any): any;
10370
10397
  deserialize(value?: any, context?: any): any;
10371
10398
  }
10399
+ type ServerOptionsHttps = SecureContextOptions &
10400
+ TlsOptions &
10401
+ ServerOptionsImport;
10372
10402
  declare class SharePlugin {
10373
10403
  constructor(options: SharePluginOptions);
10374
10404