Skip to content

Commit

Permalink
fix(live-reload): ensures that live reload will use the correct port
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Jul 21, 2016
1 parent a40fedf commit 7c0090b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ module.exports = {

config: function(/* env, baseConfig */) {
if (this.project.targetIncludesCordova) {
var conf = {};
//If cordova live reload, set the reload url
var networkAddress = getNetworkIp();
var deviceServerUrl = 'http://' + networkAddress + ':4200';
var conf = { cordova: {} };

conf.cordova = {};
conf.cordova.reloadUrl = deviceServerUrl;
if (!!this.project.RELOAD_PORT) {
//If cordova live reload, set the reload url
var networkAddress = getNetworkIp();
var deviceServerUrl = 'http://' + networkAddress + ':' + this.project.RELOAD_PORT;

conf.cordova.reloadUrl = deviceServerUrl;
}

return conf;
}
Expand Down
1 change: 1 addition & 0 deletions lib/commands/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ module.exports = {

this.project.targetIsCordova = true;
var platform = this.project.CORDOVA_PLATFORM = options.platform;
this.project.RELOAD_PORT = options.port;

validateCordovaConfig = getCordovaConfig(this.project)
.then(function(cordovaConfig) {
Expand Down

0 comments on commit 7c0090b

Please sign in to comment.