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.
This commit is contained in:
Pascal Precht 2019-06-11 10:49:00 +02:00 committed by Pascal Precht
parent 9e5c9c7f17
commit 24b53395b0
2 changed files with 5 additions and 0 deletions

View File

@ -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;
}

View File

@ -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);
};