Skip to content

Commit 5e1ff2a

Browse files
committed
Honor --public flag given to 'yarn run dev-server ...'
1 parent 853e0f9 commit 5e1ff2a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/config/parse-runtime.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ module.exports = function(argv, cwd) {
4949
runtimeConfig.useHotModuleReplacement = argv.hot || false;
5050
runtimeConfig.devServerKeepPublicPath = argv.keepPublicPath || false;
5151

52-
var host = argv.host ? argv.host : 'localhost';
53-
var port = argv.port ? argv.port : '8080';
54-
runtimeConfig.devServerUrl = `http${runtimeConfig.devServerHttps ? 's' : ''}://${host}:${port}/`;
52+
if (typeof argv.public !== 'undefined') {
53+
runtimeConfig.devServerUrl = argv.public;
54+
} else {
55+
var host = argv.host ? argv.host : 'localhost';
56+
var port = argv.port ? argv.port : '8080';
57+
runtimeConfig.devServerUrl = `http${runtimeConfig.devServerHttps ? 's' : ''}://${host}:${port}/`;
58+
}
5559

5660
break;
5761
}

0 commit comments

Comments
 (0)