@@ -538,26 +538,6 @@ class Server {
538
538
} ) ;
539
539
}
540
540
541
- runBonjour ( ) {
542
- const bonjour = require ( 'bonjour' ) ( ) ;
543
- const os = require ( 'os' ) ;
544
- const { https, port } = this . options ;
545
-
546
- bonjour . publish ( {
547
- name : `Webpack Dev Server ${ os . hostname ( ) } :${ port } ` ,
548
- port,
549
- type : https ? 'https' : 'http' ,
550
- subtypes : [ 'webpack' ] ,
551
- ...this . options . bonjour ,
552
- } ) ;
553
-
554
- process . on ( 'exit' , ( ) => {
555
- bonjour . unpublishAll ( ( ) => {
556
- bonjour . destroy ( ) ;
557
- } ) ;
558
- } ) ;
559
- }
560
-
561
541
openBrowser ( uri , options ) {
562
542
const isAbsoluteUrl = require ( 'is-absolute-url' ) ;
563
543
const open = require ( 'open' ) ;
@@ -825,7 +805,23 @@ class Server {
825
805
}
826
806
827
807
if ( this . options . bonjour ) {
828
- this . runBonjour ( ) ;
808
+ const bonjour = require ( 'bonjour' ) ( ) ;
809
+ const os = require ( 'os' ) ;
810
+ const { https, port } = this . options ;
811
+
812
+ bonjour . publish ( {
813
+ name : `Webpack Dev Server ${ os . hostname ( ) } :${ port } ` ,
814
+ port,
815
+ type : https ? 'https' : 'http' ,
816
+ subtypes : [ 'webpack' ] ,
817
+ ...this . options . bonjour ,
818
+ } ) ;
819
+
820
+ process . on ( 'exit' , ( ) => {
821
+ bonjour . unpublishAll ( ( ) => {
822
+ bonjour . destroy ( ) ;
823
+ } ) ;
824
+ } ) ;
829
825
}
830
826
831
827
this . logStatus ( ) ;
0 commit comments