File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ var optimist = require("optimist")
46
46
47
47
. describe ( "port" , "The port" ) . default ( "port" , 8080 )
48
48
49
+ . describe ( "public" , "The public hostname/ip address of the server" )
50
+
49
51
. describe ( "host" , "The hostname/ip address the server will bind to" ) . default ( "host" , "localhost" ) ;
50
52
51
53
require ( "webpack/bin/config-optimist" ) ( optimist ) ;
@@ -60,6 +62,9 @@ var options = wpOpt.devServer || firstWpOpt.devServer || {};
60
62
if ( argv . host !== "localhost" || ! options . host )
61
63
options . host = argv . host ;
62
64
65
+ if ( ! options . public )
66
+ options . public = argv . public ;
67
+
63
68
if ( argv . port !== 8080 || ! options . port )
64
69
options . port = argv . port ;
65
70
@@ -140,7 +145,7 @@ if(argv["compress"])
140
145
var protocol = options . https ? "https" : "http" ;
141
146
142
147
if ( options . inline ) {
143
- var devClient = [ require . resolve ( "../client/" ) + "?" + protocol + "://" + options . host + ":" + options . port ] ;
148
+ var devClient = [ require . resolve ( "../client/" ) + "?" + protocol + "://" + ( options . public || ( options . host + ":" + options . port ) ) ] ;
144
149
145
150
if ( options . hot )
146
151
devClient . push ( "webpack/hot/dev-server" ) ;
You can’t perform that action at this time.
0 commit comments