From 21b4cbf60d953d154f96873088d8bfd10ff49136 Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Tue, 17 Jul 2018 18:41:12 -0500 Subject: [PATCH] don't forward host/port cli options if the options weren't specified --- lib/index.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index b39ad801..89ddc321 100644 --- a/lib/index.js +++ b/lib/index.js @@ -61,6 +61,17 @@ class Embark { self.context = options.context || [constants.contexts.run, constants.contexts.build]; let Dashboard = require('./dashboard/dashboard.js'); + let webServerConfig = { + enabled: options.runWebserver + }; + + if (options.serverHost) { + webServerConfig.host = options.serverHost; + } + if (options.serverPort) { + webServerConfig.port = options.serverPort; + } + const Engine = require('./core/engine.js'); const engine = new Engine({ env: options.env, @@ -72,11 +83,7 @@ class Embark { logLevel: options.logLevel, context: self.context, useDashboard: options.useDashboard, - webServerConfig: { - enabled: options.runWebserver, - host: options.serverHost, - port: options.serverPort - } + webServerConfig: webServerConfig }); engine.init();