webpack-dev-server 4.12.0 → 4.13.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.
package/bin/cli-flags.js CHANGED
@@ -153,6 +153,23 @@ module.exports = {
153
153
  simpleType: "boolean",
154
154
  multiple: false,
155
155
  },
156
+ "client-overlay-runtime-errors": {
157
+ configs: [
158
+ {
159
+ type: "boolean",
160
+ multiple: false,
161
+ description:
162
+ "Enables a full-screen overlay in the browser when there are uncaught runtime errors.",
163
+ negatedDescription:
164
+ "Disables the full-screen overlay in the browser when there are uncaught runtime errors.",
165
+ path: "client.overlay.runtimeErrors",
166
+ },
167
+ ],
168
+ description:
169
+ "Enables a full-screen overlay in the browser when there are uncaught runtime errors.",
170
+ simpleType: "boolean",
171
+ multiple: false,
172
+ },
156
173
  "client-progress": {
157
174
  configs: [
158
175
  {
package/client/index.js CHANGED
@@ -20,7 +20,7 @@ import createSocketURL from "./utils/createSocketURL.js";
20
20
  * @property {boolean} hot
21
21
  * @property {boolean} liveReload
22
22
  * @property {boolean} progress
23
- * @property {boolean | { warnings?: boolean, errors?: boolean, trustedTypesPolicyName?: string }} overlay
23
+ * @property {boolean | { warnings?: boolean, errors?: boolean, runtimeErrors?: boolean, trustedTypesPolicyName?: string }} overlay
24
24
  * @property {string} [logging]
25
25
  * @property {number} [reconnect]
26
26
  */
@@ -79,7 +79,8 @@ if (parsedResourceQuery.overlay) {
79
79
  if (typeof options.overlay === "object") {
80
80
  options.overlay = _objectSpread({
81
81
  errors: true,
82
- warnings: true
82
+ warnings: true,
83
+ runtimeErrors: true
83
84
  }, options.overlay);
84
85
  }
85
86
  enabledFeatures.Overlay = true;
@@ -106,10 +107,15 @@ logEnabledFeatures(enabledFeatures);
106
107
  self.addEventListener("beforeunload", function () {
107
108
  status.isUnloading = true;
108
109
  });
109
- var trustedTypesPolicyName = typeof options.overlay === "object" && options.overlay.trustedTypesPolicyName;
110
- var overlay = createOverlay({
111
- trustedTypesPolicyName: trustedTypesPolicyName
112
- });
110
+ var overlay = typeof window !== "undefined" ? createOverlay(typeof options.overlay === "object" ? {
111
+ trustedTypesPolicyName: options.overlay.trustedTypesPolicyName,
112
+ catchRuntimeError: options.overlay.runtimeErrors
113
+ } : {
114
+ trustedTypesPolicyName: false,
115
+ catchRuntimeError: options.overlay
116
+ }) : {
117
+ send: function send() {}
118
+ };
113
119
  var onSocketMessage = {
114
120
  hot: function hot() {
115
121
  if (parsedResourceQuery.hot === "false") {
package/client/overlay.js CHANGED
@@ -59,6 +59,7 @@ function formatProblem(type, item) {
59
59
  /**
60
60
  * @typedef {Object} CreateOverlayOptions
61
61
  * @property {string | null} trustedTypesPolicyName
62
+ * @property {boolean} [catchRuntimeError]
62
63
  */
63
64
 
64
65
  /**
@@ -225,22 +226,24 @@ var createOverlay = function createOverlay(options) {
225
226
  },
226
227
  hideOverlay: hide
227
228
  });
228
- listenToRuntimeError(function (errorEvent) {
229
- // error property may be empty in older browser like IE
230
- var error = errorEvent.error,
231
- message = errorEvent.message;
232
- if (!error && !message) {
233
- return;
234
- }
235
- var errorObject = error instanceof Error ? error : new Error(error || message);
236
- overlayService.send({
237
- type: "RUNTIME_ERROR",
238
- messages: [{
239
- message: errorObject.message,
240
- stack: parseErrorToStacks(errorObject)
241
- }]
229
+ if (options.catchRuntimeError) {
230
+ listenToRuntimeError(function (errorEvent) {
231
+ // error property may be empty in older browser like IE
232
+ var error = errorEvent.error,
233
+ message = errorEvent.message;
234
+ if (!error && !message) {
235
+ return;
236
+ }
237
+ var errorObject = error instanceof Error ? error : new Error(error || message);
238
+ overlayService.send({
239
+ type: "RUNTIME_ERROR",
240
+ messages: [{
241
+ message: errorObject.message,
242
+ stack: parseErrorToStacks(errorObject)
243
+ }]
244
+ });
242
245
  });
243
- });
246
+ }
244
247
  return overlayService;
245
248
  };
246
249
  export { formatProblem, createOverlay };
package/lib/Server.js CHANGED
@@ -159,7 +159,7 @@ const schema = require("./options.json");
159
159
  /**
160
160
  * @typedef {Object} ClientConfiguration
161
161
  * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging]
162
- * @property {boolean | { warnings?: boolean, errors?: boolean }} [overlay]
162
+ * @property {boolean | { warnings?: boolean, errors?: boolean, runtimeErrors?: boolean }} [overlay]
163
163
  * @property {boolean} [progress]
164
164
  * @property {boolean | number} [reconnect]
165
165
  * @property {"ws" | "sockjs" | string} [webSocketTransport]
package/lib/options.json CHANGED
@@ -111,6 +111,13 @@
111
111
  "negatedDescription": "Disables the full-screen overlay in the browser when there are compiler warnings."
112
112
  }
113
113
  },
114
+ "runtimeErrors": {
115
+ "description": "Enables a full-screen overlay in the browser when there are uncaught runtime errors.",
116
+ "type": "boolean",
117
+ "cli": {
118
+ "negatedDescription": "Disables the full-screen overlay in the browser when there are uncaught runtime errors."
119
+ }
120
+ },
114
121
  "trustedTypesPolicyName": {
115
122
  "description": "The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'.",
116
123
  "type": "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack-dev-server",
3
- "version": "4.12.0",
3
+ "version": "4.13.0",
4
4
  "description": "Serves a webpack app. Updates the browser on changes.",
5
5
  "bin": "bin/webpack-dev-server.js",
6
6
  "main": "lib/Server.js",
@@ -114,6 +114,18 @@ declare const _exports: {
114
114
  simpleType: string;
115
115
  multiple: boolean;
116
116
  };
117
+ "client-overlay-runtime-errors": {
118
+ configs: {
119
+ type: string;
120
+ multiple: boolean;
121
+ description: string;
122
+ negatedDescription: string;
123
+ path: string;
124
+ }[];
125
+ description: string;
126
+ simpleType: string;
127
+ multiple: boolean;
128
+ };
117
129
  "client-progress": {
118
130
  configs: {
119
131
  type: string;
@@ -138,7 +138,7 @@ declare class Server {
138
138
  /**
139
139
  * @typedef {Object} ClientConfiguration
140
140
  * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging]
141
- * @property {boolean | { warnings?: boolean, errors?: boolean }} [overlay]
141
+ * @property {boolean | { warnings?: boolean, errors?: boolean, runtimeErrors?: boolean }} [overlay]
142
142
  * @property {boolean} [progress]
143
143
  * @property {boolean | number} [reconnect]
144
144
  * @property {"ws" | "sockjs" | string} [webSocketTransport]
@@ -316,7 +316,7 @@ declare class Server {
316
316
  /**
317
317
  * @typedef {Object} ClientConfiguration
318
318
  * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging]
319
- * @property {boolean | { warnings?: boolean, errors?: boolean }} [overlay]
319
+ * @property {boolean | { warnings?: boolean, errors?: boolean, runtimeErrors?: boolean }} [overlay]
320
320
  * @property {boolean} [progress]
321
321
  * @property {boolean | number} [reconnect]
322
322
  * @property {"ws" | "sockjs" | string} [webSocketTransport]
@@ -416,6 +416,82 @@ declare class Server {
416
416
  simpleType: string;
417
417
  multiple: boolean;
418
418
  };
419
+ "client-overlay-runtime-errors": {
420
+ configs: {
421
+ type: string;
422
+ multiple: boolean;
423
+ description: string;
424
+ /**
425
+ * @typedef {Object} Open
426
+ * @property {string | string[] | OpenApp} [app]
427
+ * @property {string | string[]} [target]
428
+ */
429
+ /**
430
+ * @typedef {Object} NormalizedOpen
431
+ * @property {string} target
432
+ * @property {import("open").Options} options
433
+ */
434
+ /**
435
+ * @typedef {Object} WebSocketURL
436
+ * @property {string} [hostname]
437
+ * @property {string} [password]
438
+ * @property {string} [pathname]
439
+ * @property {number | string} [port]
440
+ * @property {string} [protocol]
441
+ * @property {string} [username]
442
+ */
443
+ /**
444
+ * @typedef {Object} ClientConfiguration
445
+ * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging]
446
+ * @property {boolean | { warnings?: boolean, errors?: boolean, runtimeErrors?: boolean }} [overlay]
447
+ * @property {boolean} [progress]
448
+ * @property {boolean | number} [reconnect]
449
+ * @property {"ws" | "sockjs" | string} [webSocketTransport]
450
+ * @property {string | WebSocketURL} [webSocketURL]
451
+ */
452
+ /**
453
+ * @typedef {Array<{ key: string; value: string }> | Record<string, string | string[]>} Headers
454
+ */
455
+ /**
456
+ * @typedef {{ name?: string, path?: string, middleware: ExpressRequestHandler | ExpressErrorRequestHandler } | ExpressRequestHandler | ExpressErrorRequestHandler} Middleware
457
+ */
458
+ /**
459
+ * @typedef {Object} Configuration
460
+ * @property {boolean | string} [ipc]
461
+ * @property {Host} [host]
462
+ * @property {Port} [port]
463
+ * @property {boolean | "only"} [hot]
464
+ * @property {boolean} [liveReload]
465
+ * @property {DevMiddlewareOptions<Request, Response>} [devMiddleware]
466
+ * @property {boolean} [compress]
467
+ * @property {boolean} [magicHtml]
468
+ * @property {"auto" | "all" | string | string[]} [allowedHosts]
469
+ * @property {boolean | ConnectHistoryApiFallbackOptions} [historyApiFallback]
470
+ * @property {boolean} [setupExitSignals]
471
+ * @property {boolean | Record<string, never> | BonjourOptions} [bonjour]
472
+ * @property {string | string[] | WatchFiles | Array<string | WatchFiles>} [watchFiles]
473
+ * @property {boolean | string | Static | Array<string | Static>} [static]
474
+ * @property {boolean | ServerOptions} [https]
475
+ * @property {boolean} [http2]
476
+ * @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server]
477
+ * @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer]
478
+ * @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy]
479
+ * @property {boolean | string | Open | Array<string | Open>} [open]
480
+ * @property {boolean} [setupExitSignals]
481
+ * @property {boolean | ClientConfiguration} [client]
482
+ * @property {Headers | ((req: Request, res: Response, context: DevMiddlewareContext<Request, Response>) => Headers)} [headers]
483
+ * @property {(devServer: Server) => void} [onAfterSetupMiddleware]
484
+ * @property {(devServer: Server) => void} [onBeforeSetupMiddleware]
485
+ * @property {(devServer: Server) => void} [onListening]
486
+ * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares]
487
+ */
488
+ negatedDescription: string;
489
+ path: string;
490
+ }[];
491
+ description: string;
492
+ simpleType: string;
493
+ multiple: boolean;
494
+ };
419
495
  "client-progress": {
420
496
  configs: {
421
497
  type: string;
@@ -428,60 +504,6 @@ declare class Server {
428
504
  simpleType: string;
429
505
  multiple: boolean;
430
506
  };
431
- /**
432
- * @typedef {Object} WebSocketURL
433
- * @property {string} [hostname]
434
- * @property {string} [password]
435
- * @property {string} [pathname]
436
- * @property {number | string} [port]
437
- * @property {string} [protocol]
438
- * @property {string} [username]
439
- */
440
- /**
441
- * @typedef {Object} ClientConfiguration
442
- * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging]
443
- * @property {boolean | { warnings?: boolean, errors?: boolean }} [overlay]
444
- * @property {boolean} [progress]
445
- * @property {boolean | number} [reconnect]
446
- * @property {"ws" | "sockjs" | string} [webSocketTransport]
447
- * @property {string | WebSocketURL} [webSocketURL]
448
- */
449
- /**
450
- * @typedef {Array<{ key: string; value: string }> | Record<string, string | string[]>} Headers
451
- */
452
- /**
453
- * @typedef {{ name?: string, path?: string, middleware: ExpressRequestHandler | ExpressErrorRequestHandler } | ExpressRequestHandler | ExpressErrorRequestHandler} Middleware
454
- */
455
- /**
456
- * @typedef {Object} Configuration
457
- * @property {boolean | string} [ipc]
458
- * @property {Host} [host]
459
- * @property {Port} [port]
460
- * @property {boolean | "only"} [hot]
461
- * @property {boolean} [liveReload]
462
- * @property {DevMiddlewareOptions<Request, Response>} [devMiddleware]
463
- * @property {boolean} [compress]
464
- * @property {boolean} [magicHtml]
465
- * @property {"auto" | "all" | string | string[]} [allowedHosts]
466
- * @property {boolean | ConnectHistoryApiFallbackOptions} [historyApiFallback]
467
- * @property {boolean} [setupExitSignals]
468
- * @property {boolean | Record<string, never> | BonjourOptions} [bonjour]
469
- * @property {string | string[] | WatchFiles | Array<string | WatchFiles>} [watchFiles]
470
- * @property {boolean | string | Static | Array<string | Static>} [static]
471
- * @property {boolean | ServerOptions} [https]
472
- * @property {boolean} [http2]
473
- * @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server]
474
- * @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer]
475
- * @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy]
476
- * @property {boolean | string | Open | Array<string | Open>} [open]
477
- * @property {boolean} [setupExitSignals]
478
- * @property {boolean | ClientConfiguration} [client]
479
- * @property {Headers | ((req: Request, res: Response, context: DevMiddlewareContext<Request, Response>) => Headers)} [headers]
480
- * @property {(devServer: Server) => void} [onAfterSetupMiddleware]
481
- * @property {(devServer: Server) => void} [onBeforeSetupMiddleware]
482
- * @property {(devServer: Server) => void} [onListening]
483
- * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares]
484
- */
485
507
  "client-reconnect": {
486
508
  configs: (
487
509
  | {
@@ -540,6 +562,10 @@ declare class Server {
540
562
  description: string;
541
563
  path: string;
542
564
  }[];
565
+ /**
566
+ * @param {Configuration | Compiler | MultiCompiler} options
567
+ * @param {Compiler | MultiCompiler | Configuration} compiler
568
+ */
543
569
  description: string;
544
570
  simpleType: string;
545
571
  multiple: boolean;
@@ -565,18 +591,22 @@ declare class Server {
565
591
  description: string;
566
592
  simpleType: string;
567
593
  multiple: boolean;
594
+ /**
595
+ * @type {FSWatcher[]}
596
+ */
568
597
  };
569
598
  "client-web-socket-url-port": {
570
599
  configs: {
571
600
  type: string;
572
601
  multiple: boolean;
573
602
  description: string;
603
+ /**
604
+ * @private
605
+ * @type {RequestHandler[]}
606
+ */
574
607
  path: string;
575
608
  }[];
576
609
  description: string;
577
- /**
578
- * @type {FSWatcher[]}
579
- */
580
610
  simpleType: string;
581
611
  multiple: boolean;
582
612
  };
@@ -611,10 +641,6 @@ declare class Server {
611
641
  simpleType: string;
612
642
  multiple: boolean;
613
643
  };
614
- /**
615
- * @param {string} URL
616
- * @returns {boolean}
617
- */
618
644
  compress: {
619
645
  configs: {
620
646
  type: string;
@@ -625,10 +651,6 @@ declare class Server {
625
651
  }[];
626
652
  description: string;
627
653
  simpleType: string;
628
- /**
629
- * @param {string} gateway
630
- * @returns {string | undefined}
631
- */
632
654
  multiple: boolean;
633
655
  };
634
656
  "history-api-fallback": {
@@ -661,10 +683,6 @@ declare class Server {
661
683
  )[];
662
684
  description: string;
663
685
  simpleType: string;
664
- /**
665
- * @param {Host} hostname
666
- * @returns {Promise<string>}
667
- */
668
686
  multiple: boolean;
669
687
  };
670
688
  hot: {
@@ -754,6 +772,7 @@ declare class Server {
754
772
  }[];
755
773
  description: string;
756
774
  multiple: boolean;
775
+ /** @type {ServerConfiguration} */
757
776
  simpleType: string;
758
777
  };
759
778
  "https-cert": {
@@ -761,10 +780,10 @@ declare class Server {
761
780
  type: string;
762
781
  multiple: boolean;
763
782
  description: string;
764
- path: string /** @type {string} */;
783
+ path: string;
765
784
  }[];
766
785
  description: string;
767
- simpleType: string;
786
+ /** @type {string} */ simpleType: string;
768
787
  multiple: boolean;
769
788
  };
770
789
  "https-cert-reset": {
@@ -796,7 +815,7 @@ declare class Server {
796
815
  path: string;
797
816
  type: string;
798
817
  }[];
799
- /** @type {number | string} */ description: string;
818
+ description: string;
800
819
  multiple: boolean;
801
820
  simpleType: string;
802
821
  };
@@ -818,7 +837,7 @@ declare class Server {
818
837
  path: string;
819
838
  type: string;
820
839
  }[];
821
- /** @type {string} */ description: string;
840
+ description: string;
822
841
  multiple: boolean;
823
842
  simpleType: string;
824
843
  };
@@ -886,13 +905,8 @@ declare class Server {
886
905
  description: string;
887
906
  simpleType: string;
888
907
  multiple: boolean;
889
- /**
890
- * prependEntry Method for webpack 4
891
- * @param {any} originalEntry
892
- * @param {any} newAdditionalEntries
893
- * @returns {any}
894
- */
895
908
  };
909
+ /** @type {Object<string,string>} */
896
910
  "live-reload": {
897
911
  configs: {
898
912
  type: string;
@@ -954,6 +968,10 @@ declare class Server {
954
968
  multiple: boolean;
955
969
  description: string;
956
970
  path: string;
971
+ /**
972
+ * @private
973
+ * @returns {Promise<void>}
974
+ */
957
975
  }[];
958
976
  description: string;
959
977
  simpleType: string;
@@ -964,7 +982,7 @@ declare class Server {
964
982
  type: string;
965
983
  multiple: boolean;
966
984
  description: string;
967
- path: string /** @type {Compiler} */;
985
+ path: string;
968
986
  }[];
969
987
  description: string;
970
988
  simpleType: string;
@@ -1206,8 +1224,8 @@ declare class Server {
1206
1224
  path: string;
1207
1225
  }
1208
1226
  )[];
1209
- /** @type {ServerOptions} */ description: string;
1210
- /** @type {Array<keyof ServerOptions>} */ simpleType: string;
1227
+ description: string;
1228
+ simpleType: string;
1211
1229
  multiple: boolean;
1212
1230
  };
1213
1231
  "static-directory": {
@@ -1218,6 +1236,10 @@ declare class Server {
1218
1236
  path: string;
1219
1237
  }[];
1220
1238
  description: string;
1239
+ /**
1240
+ * @param {string | Buffer | undefined} item
1241
+ * @returns {string | Buffer | undefined}
1242
+ */
1221
1243
  simpleType: string;
1222
1244
  multiple: boolean;
1223
1245
  };
@@ -1230,7 +1252,7 @@ declare class Server {
1230
1252
  }[];
1231
1253
  description: string;
1232
1254
  simpleType: string;
1233
- multiple: boolean;
1255
+ multiple: boolean /** @type {any} */;
1234
1256
  };
1235
1257
  "static-public-path-reset": {
1236
1258
  configs: {
@@ -1248,7 +1270,7 @@ declare class Server {
1248
1270
  type: string;
1249
1271
  multiple: boolean;
1250
1272
  description: string;
1251
- path: string /** @type {ServerOptions} */;
1273
+ path: string;
1252
1274
  }[];
1253
1275
  description: string;
1254
1276
  simpleType: string;
@@ -1542,7 +1564,7 @@ declare class Server {
1542
1564
  /**
1543
1565
  * @typedef {Object} ClientConfiguration
1544
1566
  * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging]
1545
- * @property {boolean | { warnings?: boolean, errors?: boolean }} [overlay]
1567
+ * @property {boolean | { warnings?: boolean, errors?: boolean, runtimeErrors?: boolean }} [overlay]
1546
1568
  * @property {boolean} [progress]
1547
1569
  * @property {boolean | number} [reconnect]
1548
1570
  * @property {"ws" | "sockjs" | string} [webSocketTransport]
@@ -1640,6 +1662,13 @@ declare class Server {
1640
1662
  negatedDescription: string;
1641
1663
  };
1642
1664
  };
1665
+ runtimeErrors: {
1666
+ description: string;
1667
+ type: string;
1668
+ cli: {
1669
+ negatedDescription: string;
1670
+ };
1671
+ };
1643
1672
  trustedTypesPolicyName: {
1644
1673
  description: string;
1645
1674
  type: string;
@@ -1664,15 +1693,7 @@ declare class Server {
1664
1693
  link: string;
1665
1694
  anyOf: (
1666
1695
  | {
1667
- /**
1668
- * @typedef {{ path?: HttpProxyMiddlewareOptionsFilter | undefined, context?: HttpProxyMiddlewareOptionsFilter | undefined } & { bypass?: ByPass } & HttpProxyMiddlewareOptions } ProxyConfigArrayItem
1669
- */
1670
- /**
1671
- * @typedef {(ProxyConfigArrayItem | ((req?: Request | undefined, res?: Response | undefined, next?: NextFunction | undefined) => ProxyConfigArrayItem))[]} ProxyConfigArray
1672
- */
1673
- /**
1674
- * @typedef {{ [url: string]: string | ProxyConfigArrayItem }} ProxyConfigMap
1675
- */
1696
+ type: string;
1676
1697
  /**
1677
1698
  * @typedef {Object} OpenApp
1678
1699
  * @property {string} [name]
@@ -1700,7 +1721,7 @@ declare class Server {
1700
1721
  /**
1701
1722
  * @typedef {Object} ClientConfiguration
1702
1723
  * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging]
1703
- * @property {boolean | { warnings?: boolean, errors?: boolean }} [overlay]
1724
+ * @property {boolean | { warnings?: boolean, errors?: boolean, runtimeErrors?: boolean }} [overlay]
1704
1725
  * @property {boolean} [progress]
1705
1726
  * @property {boolean | number} [reconnect]
1706
1727
  * @property {"ws" | "sockjs" | string} [webSocketTransport]
@@ -1742,7 +1763,6 @@ declare class Server {
1742
1763
  * @property {(devServer: Server) => void} [onListening]
1743
1764
  * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares]
1744
1765
  */
1745
- type: string;
1746
1766
  cli: {
1747
1767
  negatedDescription: string;
1748
1768
  };
@@ -1759,75 +1779,6 @@ declare class Server {
1759
1779
  anyOf: {
1760
1780
  $ref: string;
1761
1781
  }[];
1762
- /**
1763
- * @typedef {Object} OpenApp
1764
- * @property {string} [name]
1765
- * @property {string[]} [arguments]
1766
- */
1767
- /**
1768
- * @typedef {Object} Open
1769
- * @property {string | string[] | OpenApp} [app]
1770
- * @property {string | string[]} [target]
1771
- */
1772
- /**
1773
- * @typedef {Object} NormalizedOpen
1774
- * @property {string} target
1775
- * @property {import("open").Options} options
1776
- */
1777
- /**
1778
- * @typedef {Object} WebSocketURL
1779
- * @property {string} [hostname]
1780
- * @property {string} [password]
1781
- * @property {string} [pathname]
1782
- * @property {number | string} [port]
1783
- * @property {string} [protocol]
1784
- * @property {string} [username]
1785
- */
1786
- /**
1787
- * @typedef {Object} ClientConfiguration
1788
- * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging]
1789
- * @property {boolean | { warnings?: boolean, errors?: boolean }} [overlay]
1790
- * @property {boolean} [progress]
1791
- * @property {boolean | number} [reconnect]
1792
- * @property {"ws" | "sockjs" | string} [webSocketTransport]
1793
- * @property {string | WebSocketURL} [webSocketURL]
1794
- */
1795
- /**
1796
- * @typedef {Array<{ key: string; value: string }> | Record<string, string | string[]>} Headers
1797
- */
1798
- /**
1799
- * @typedef {{ name?: string, path?: string, middleware: ExpressRequestHandler | ExpressErrorRequestHandler } | ExpressRequestHandler | ExpressErrorRequestHandler} Middleware
1800
- */
1801
- /**
1802
- * @typedef {Object} Configuration
1803
- * @property {boolean | string} [ipc]
1804
- * @property {Host} [host]
1805
- * @property {Port} [port]
1806
- * @property {boolean | "only"} [hot]
1807
- * @property {boolean} [liveReload]
1808
- * @property {DevMiddlewareOptions<Request, Response>} [devMiddleware]
1809
- * @property {boolean} [compress]
1810
- * @property {boolean} [magicHtml]
1811
- * @property {"auto" | "all" | string | string[]} [allowedHosts]
1812
- * @property {boolean | ConnectHistoryApiFallbackOptions} [historyApiFallback]
1813
- * @property {boolean} [setupExitSignals]
1814
- * @property {boolean | Record<string, never> | BonjourOptions} [bonjour]
1815
- * @property {string | string[] | WatchFiles | Array<string | WatchFiles>} [watchFiles]
1816
- * @property {boolean | string | Static | Array<string | Static>} [static]
1817
- * @property {boolean | ServerOptions} [https]
1818
- * @property {boolean} [http2]
1819
- * @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server]
1820
- * @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer]
1821
- * @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy]
1822
- * @property {boolean | string | Open | Array<string | Open>} [open]
1823
- * @property {boolean} [setupExitSignals]
1824
- * @property {boolean | ClientConfiguration} [client]
1825
- * @property {Headers | ((req: Request, res: Response, context: DevMiddlewareContext<Request, Response>) => Headers)} [headers]
1826
- * @property {(devServer: Server) => void} [onAfterSetupMiddleware]
1827
- * @property {(devServer: Server) => void} [onBeforeSetupMiddleware]
1828
- * @property {(devServer: Server) => void} [onListening]
1829
- * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares]
1830
- */
1831
1782
  description: string;
1832
1783
  link: string;
1833
1784
  };
@@ -1837,15 +1788,6 @@ declare class Server {
1837
1788
  ClientWebSocketTransportString: {
1838
1789
  type: string;
1839
1790
  minLength: number;
1840
- /**
1841
- * @typedef {Object} WebSocketURL
1842
- * @property {string} [hostname]
1843
- * @property {string} [password]
1844
- * @property {string} [pathname]
1845
- * @property {number | string} [port]
1846
- * @property {string} [protocol]
1847
- * @property {string} [username]
1848
- */
1849
1791
  };
1850
1792
  ClientWebSocketURL: {
1851
1793
  description: string;
@@ -1859,6 +1801,36 @@ declare class Server {
1859
1801
  }
1860
1802
  | {
1861
1803
  type: string;
1804
+ /**
1805
+ * @typedef {Object} Configuration
1806
+ * @property {boolean | string} [ipc]
1807
+ * @property {Host} [host]
1808
+ * @property {Port} [port]
1809
+ * @property {boolean | "only"} [hot]
1810
+ * @property {boolean} [liveReload]
1811
+ * @property {DevMiddlewareOptions<Request, Response>} [devMiddleware]
1812
+ * @property {boolean} [compress]
1813
+ * @property {boolean} [magicHtml]
1814
+ * @property {"auto" | "all" | string | string[]} [allowedHosts]
1815
+ * @property {boolean | ConnectHistoryApiFallbackOptions} [historyApiFallback]
1816
+ * @property {boolean} [setupExitSignals]
1817
+ * @property {boolean | Record<string, never> | BonjourOptions} [bonjour]
1818
+ * @property {string | string[] | WatchFiles | Array<string | WatchFiles>} [watchFiles]
1819
+ * @property {boolean | string | Static | Array<string | Static>} [static]
1820
+ * @property {boolean | ServerOptions} [https]
1821
+ * @property {boolean} [http2]
1822
+ * @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server]
1823
+ * @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer]
1824
+ * @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy]
1825
+ * @property {boolean | string | Open | Array<string | Open>} [open]
1826
+ * @property {boolean} [setupExitSignals]
1827
+ * @property {boolean | ClientConfiguration} [client]
1828
+ * @property {Headers | ((req: Request, res: Response, context: DevMiddlewareContext<Request, Response>) => Headers)} [headers]
1829
+ * @property {(devServer: Server) => void} [onAfterSetupMiddleware]
1830
+ * @property {(devServer: Server) => void} [onBeforeSetupMiddleware]
1831
+ * @property {(devServer: Server) => void} [onListening]
1832
+ * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares]
1833
+ */
1862
1834
  additionalProperties: boolean;
1863
1835
  properties: {
1864
1836
  hostname: {
@@ -1957,6 +1929,10 @@ declare class Server {
1957
1929
  cli: {
1958
1930
  negatedDescription: string;
1959
1931
  };
1932
+ /**
1933
+ * @private
1934
+ * @type {RequestHandler[]}
1935
+ */
1960
1936
  };
1961
1937
  ca: {
1962
1938
  anyOf: (
@@ -2052,10 +2028,6 @@ declare class Server {
2052
2028
  description: string;
2053
2029
  };
2054
2030
  crl: {
2055
- /**
2056
- * @param {"v4" | "v6"} family
2057
- * @returns {Promise<string | undefined>}
2058
- */
2059
2031
  anyOf: (
2060
2032
  | {
2061
2033
  type: string;
@@ -2224,7 +2196,7 @@ declare class Server {
2224
2196
  }
2225
2197
  | {
2226
2198
  type: string;
2227
- description: string;
2199
+ /** @type {WebSocketURL} */ description: string;
2228
2200
  link: string;
2229
2201
  cli?: undefined /** @typedef {import("express").Request} Request */;
2230
2202
  }
@@ -2238,7 +2210,7 @@ declare class Server {
2238
2210
  anyOf: (
2239
2211
  | {
2240
2212
  enum: string[];
2241
- type?: undefined;
2213
+ /** @type {ServerConfiguration} */ type?: undefined;
2242
2214
  minLength?: undefined;
2243
2215
  }
2244
2216
  | {
@@ -2339,7 +2311,6 @@ declare class Server {
2339
2311
  negatedDescription: string;
2340
2312
  };
2341
2313
  };
2342
- /** @type {ClientConfiguration} */
2343
2314
  OpenObject: {
2344
2315
  type: string;
2345
2316
  additionalProperties: boolean;
@@ -2410,6 +2381,12 @@ declare class Server {
2410
2381
  };
2411
2382
  };
2412
2383
  };
2384
+ /**
2385
+ * prependEntry Method for webpack 4
2386
+ * @param {any} originalEntry
2387
+ * @param {any} newAdditionalEntries
2388
+ * @returns {any}
2389
+ */
2413
2390
  OpenString: {
2414
2391
  type: string;
2415
2392
  minLength: number;
@@ -2464,13 +2441,13 @@ declare class Server {
2464
2441
  }
2465
2442
  )[];
2466
2443
  description: string;
2444
+ /** @type {any} */
2467
2445
  link: string;
2468
2446
  };
2469
2447
  Server: {
2470
2448
  anyOf: {
2471
2449
  $ref: string;
2472
2450
  }[];
2473
- /** @type {any} */
2474
2451
  link: string;
2475
2452
  description: string;
2476
2453
  };
@@ -2492,7 +2469,6 @@ declare class Server {
2492
2469
  };
2493
2470
  ServerObject: {
2494
2471
  type: string;
2495
- /** @type {string} */
2496
2472
  properties: {
2497
2473
  type: {
2498
2474
  anyOf: {
@@ -2500,7 +2476,7 @@ declare class Server {
2500
2476
  }[];
2501
2477
  };
2502
2478
  options: {
2503
- $ref: string /** @type {MultiCompiler} */;
2479
+ $ref: string;
2504
2480
  };
2505
2481
  };
2506
2482
  additionalProperties: boolean;
@@ -2513,7 +2489,6 @@ declare class Server {
2513
2489
  type: string;
2514
2490
  description: string;
2515
2491
  };
2516
- /** @type {MultiCompiler} */
2517
2492
  requestCert: {
2518
2493
  type: string;
2519
2494
  description: string;
@@ -2930,7 +2905,7 @@ declare class Server {
2930
2905
  };
2931
2906
  };
2932
2907
  WebSocketServerFunction: {
2933
- instanceof: string;
2908
+ instanceof: string /** @type {ServerOptions} */;
2934
2909
  };
2935
2910
  WebSocketServerObject: {
2936
2911
  type: string;
@@ -2942,7 +2917,6 @@ declare class Server {
2942
2917
  };
2943
2918
  options: {
2944
2919
  type: string;
2945
- /** @type {Array<keyof ServerOptions>} */
2946
2920
  additionalProperties: boolean;
2947
2921
  cli: {
2948
2922
  exclude: boolean;
@@ -2979,7 +2953,6 @@ declare class Server {
2979
2953
  historyApiFallback: {
2980
2954
  $ref: string;
2981
2955
  };
2982
- /** @type {ServerOptions} */
2983
2956
  host: {
2984
2957
  $ref: string;
2985
2958
  };
@@ -3001,6 +2974,7 @@ declare class Server {
3001
2974
  magicHtml: {
3002
2975
  $ref: string;
3003
2976
  };
2977
+ /** @type {any} */
3004
2978
  onAfterSetupMiddleware: {
3005
2979
  $ref: string;
3006
2980
  };
@@ -3625,6 +3599,7 @@ type ClientConfiguration = {
3625
3599
  | {
3626
3600
  warnings?: boolean | undefined;
3627
3601
  errors?: boolean | undefined;
3602
+ runtimeErrors?: boolean | undefined;
3628
3603
  }
3629
3604
  | undefined;
3630
3605
  progress?: boolean | undefined;