Skip to content

Commit 99c6d99

Browse files
committed
Added a flag for public ip to seed the inline frame.
Note: As this will default to using host to ensure backward compatibility.
1 parent c52035e commit 99c6d99

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
@@ -46,6 +46,8 @@ var optimist = require("optimist")
4646

4747
.describe("port", "The port").default("port", 8080)
4848

49+
.describe("public", "The public hostname/ip address of the server")
50+
4951
.describe("host", "The hostname/ip address the server will bind to").default("host", "localhost");
5052

5153
require("webpack/bin/config-optimist")(optimist);
@@ -60,6 +62,9 @@ var options = wpOpt.devServer || firstWpOpt.devServer || {};
6062
if(argv.host !== "localhost" || !options.host)
6163
options.host = argv.host;
6264

65+
if(!options.public)
66+
options.public = argv.public;
67+
6368
if(argv.port !== 8080 || !options.port)
6469
options.port = argv.port;
6570

@@ -140,7 +145,7 @@ if(argv["compress"])
140145
var protocol = options.https ? "https" : "http";
141146

142147
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))];
144149

145150
if(options.hot)
146151
devClient.push("webpack/hot/dev-server");

0 commit comments

Comments
 (0)