From 852658d92f9a8b31af6d82c9a6024220982a65a4 Mon Sep 17 00:00:00 2001 From: caryli Date: Tue, 3 Oct 2017 03:01:51 -0700 Subject: [PATCH] Set addDevServerEntrypoints default to 'localhost' Set the default for the host injected by addDevServerEntrypoints to 'localhost' when using webpack-dev-server with the Node.js API and calling addDevServerEntrypoints directly with arguments devServerOptions.host and devServerOptions.useLocalIp both undefined. --- lib/util/createDomain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/createDomain.js b/lib/util/createDomain.js index df7867b4b0..bc0d329e87 100644 --- a/lib/util/createDomain.js +++ b/lib/util/createDomain.js @@ -8,7 +8,7 @@ module.exports = function createDomain(options, listeningApp) { const protocol = options.https ? 'https' : 'http'; const appPort = listeningApp ? listeningApp.address().port : 0; const port = options.socket ? 0 : appPort; - const hostname = options.useLocalIp ? internalIp.v4() : options.host; + const hostname = options.useLocalIp ? internalIp.v4() : options.host || 'localhost'; // the formatted domain (url without path) of the webpack server return options.public ? `${protocol}://${options.public}` : url.format({