From 24b53395b01d5e0a7cefadb55e00c3f036fc944a Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 11 Jun 2019 10:49:00 +0200 Subject: [PATCH] fix(@embark/config): disable webserver if pipeline is disabled The webserver's job is to serve files generated by Embark's built-in pipeline, however, since v4 users can choose they front-end tool to take care of building, bundling and packing their DApps. Usually these tools come with a built-in dev server as well. Therefore, when the pipeline is turned off (which also soon will be the default), there's not need start a webserver. --- packages/embark-webserver/src/index.js | 1 + packages/embark/src/lib/core/config.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/packages/embark-webserver/src/index.js b/packages/embark-webserver/src/index.js index a86a6a6e4..d4d91315d 100644 --- a/packages/embark-webserver/src/index.js +++ b/packages/embark-webserver/src/index.js @@ -16,6 +16,7 @@ class WebServer { this.fs = embark.fs; this.buildDir = embark.config.buildDir; this.webServerConfig = embark.config.webServerConfig; + if (!this.webServerConfig.enabled) { return; } diff --git a/packages/embark/src/lib/core/config.js b/packages/embark/src/lib/core/config.js index 907315079..be691c0a8 100644 --- a/packages/embark/src/lib/core/config.js +++ b/packages/embark/src/lib/core/config.js @@ -532,6 +532,10 @@ Config.prototype.loadWebServerConfigFile = function() { this.webServerConfig = webServerConfig; } + if (!this.pipelineConfig.enabled) { + this.webServerConfig.enabled = false; + } + this.events.emit('config:load:webserver', this.webServerConfig); };