@@ -29,8 +29,8 @@ const schema = require("./options.json");
29
29
/** @typedef {import("chokidar").WatchOptions } WatchOptions */
30
30
/** @typedef {import("chokidar").FSWatcher } FSWatcher */
31
31
/** @typedef {import("connect-history-api-fallback").Options } ConnectHistoryApiFallbackOptions */
32
- /** @typedef {import("bonjour").Bonjour } Bonjour */
33
- /** @typedef {import("bonjour").BonjourOptions } BonjourOptions */
32
+ /** @typedef {import("bonjour-service ").Bonjour } Bonjour */
33
+ /** @typedef {import("bonjour-service ").Service } BonjourOptions */
34
34
/** @typedef {import("http-proxy-middleware").RequestHandler } RequestHandler */
35
35
/** @typedef {import("http-proxy-middleware").Options } HttpProxyMiddlewareOptions */
36
36
/** @typedef {import("http-proxy-middleware").Filter } HttpProxyMiddlewareOptionsFilter */
@@ -188,7 +188,7 @@ const schema = require("./options.json");
188
188
* @property {"auto" | "all" | string | string[] } [allowedHosts]
189
189
* @property {boolean | ConnectHistoryApiFallbackOptions } [historyApiFallback]
190
190
* @property {boolean } [setupExitSignals]
191
- * @property {boolean | BonjourOptions } [bonjour]
191
+ * @property {boolean | Record<string, never> | BonjourOptions } [bonjour]
192
192
* @property {string | string[] | WatchFiles | Array<string | WatchFiles> } [watchFiles]
193
193
* @property {boolean | string | Static | Array<string | Static> } [static]
194
194
* @property {boolean | ServerOptions } [https]
@@ -2594,14 +2594,18 @@ class Server {
2594
2594
* @returns {void }
2595
2595
*/
2596
2596
runBonjour ( ) {
2597
+ const { Bonjour } = require ( "bonjour-service" ) ;
2597
2598
/**
2598
2599
* @private
2599
- * @type {import("bonjour"). Bonjour | undefined }
2600
+ * @type {Bonjour | undefined }
2600
2601
*/
2601
- this . bonjour = require ( "bonjour" ) ( ) ;
2602
+ this . bonjour = new Bonjour ( ) ;
2602
2603
this . bonjour . publish ( {
2604
+ // @ts -expect-error
2603
2605
name : `Webpack Dev Server ${ os . hostname ( ) } :${ this . options . port } ` ,
2606
+ // @ts -expect-error
2604
2607
port : /** @type {number } */ ( this . options . port ) ,
2608
+ // @ts -expect-error
2605
2609
type :
2606
2610
/** @type {ServerConfiguration } */
2607
2611
( this . options . server ) . type === "http" ? "http" : "https" ,
0 commit comments