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 @@ -51,6 +51,8 @@ var optimist = require("optimist")
51
51
52
52
. describe ( "port" , "The port" ) . default ( "port" , 8080 )
53
53
54
+ . describe ( "public" , "The public hostname/ip address of the server" )
55
+
54
56
. describe ( "host" , "The hostname/ip address the server will bind to" ) . default ( "host" , "localhost" ) ;
55
57
56
58
require ( "webpack/bin/config-optimist" ) ( optimist ) ;
@@ -67,6 +69,9 @@ var options = wpOpt.devServer || firstWpOpt.devServer || {};
67
69
if ( argv . host !== "localhost" || ! options . host )
68
70
options . host = argv . host ;
69
71
72
+ if ( ! options . public )
73
+ options . public = argv . public ;
74
+
70
75
if ( argv . port !== 8080 || ! options . port )
71
76
options . port = argv . port ;
72
77
@@ -160,7 +165,7 @@ if(argv["open"])
160
165
var protocol = options . https ? "https" : "http" ;
161
166
162
167
if ( options . inline ) {
163
- var devClient = [ require . resolve ( "../client/" ) + "?" + protocol + "://" + options . host + ":" + options . port ] ;
168
+ var devClient = [ require . resolve ( "../client/" ) + "?" + protocol + "://" + ( options . public || ( options . host + ":" + options . port ) ) ] ;
164
169
165
170
if ( options . hot )
166
171
devClient . push ( "webpack/hot/dev-server" ) ;
You can’t perform that action at this time.
0 commit comments