Skip to content

Commit d80bd1a

Browse files
committed
Merge pull request #368 from chrishowes/wolfeidau
[MERGABLE] Added a flag for public ip to seed the inline frame.
2 parents 33ebd1f + 639f2b0 commit d80bd1a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/webpack-dev-server.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ var optimist = require("optimist")
5151

5252
.describe("port", "The port").default("port", 8080)
5353

54+
.describe("public", "The public hostname/ip address of the server")
55+
5456
.describe("host", "The hostname/ip address the server will bind to").default("host", "localhost");
5557

5658
require("webpack/bin/config-optimist")(optimist);
@@ -67,6 +69,9 @@ var options = wpOpt.devServer || firstWpOpt.devServer || {};
6769
if(argv.host !== "localhost" || !options.host)
6870
options.host = argv.host;
6971

72+
if(!options.public)
73+
options.public = argv.public;
74+
7075
if(argv.port !== 8080 || !options.port)
7176
options.port = argv.port;
7277

@@ -160,7 +165,7 @@ if(argv["open"])
160165
var protocol = options.https ? "https" : "http";
161166

162167
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))];
164169

165170
if(options.hot)
166171
devClient.push("webpack/hot/dev-server");

0 commit comments

Comments
 (0)