Skip to content

Commit ddcc2a0

Browse files
committed
fix(serve): prevent emulate and run livereload from using app-scripts for now.
1 parent f53eea9 commit ddcc2a0

File tree

2 files changed

+30
-25
lines changed

2 files changed

+30
-25
lines changed

lib/ionic/emulate.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,39 +80,41 @@ function run(ionic, argv, rawCliArguments) {
8080
hasBuildCommand = results[2];
8181
hasServeCommand = results[3];
8282

83-
if (hasBuildCommand && !(isLiveReload && hasServeCommand)) {
83+
if (hasBuildCommand) {
8484
return npmScripts.runIonicScript('build');
8585
}
8686
return Q();
8787
})
8888
.then(function() {
8989

90-
if (isLiveReload && hasServeCommand) {
90+
if (isLiveReload && hasServeCommand && false) {
9191

9292
// using app-scripts and livereload is requested
9393
return ConfigXml.setConfigXml(process.cwd(), {
9494
devServer: serveUtil.getUrl(address, port)
95-
}).then(function() {
96-
isLiveReload = false;
97-
return npmScripts.runIonicScript('serve', ['-p', port, '--address', address]);
9895
});
9996
} else if (isLiveReload) {
10097

10198
// not an app-scripts project but the user wants livereload
10299
return cordovaUtils.setupLiveReload(argv, appDirectory);
103-
} else {
104-
105-
// ensure the content node was set back to its original
106-
return ConfigXml.setConfigXml(appDirectory, {
107-
resetContent: true,
108-
errorWhenNotFound: false
109-
});
110100
}
101+
102+
// ensure the content node was set back to its original
103+
return ConfigXml.setConfigXml(appDirectory, {
104+
resetContent: true,
105+
errorWhenNotFound: false
106+
});
111107
})
112108
.then(function(serveOptions) {
113109
var optionList = cordovaUtils.filterArgumentsForCordova(cmdName, argv, rawArgs);
114110
return cordovaUtils.execCordovaCommand(optionList, isLiveReload, serveOptions);
115111
})
112+
.then(function() {
113+
if (isLiveReload && hasServeCommand && false) {
114+
return npmScripts.runIonicScript('serve', ['-p', port, '--address', address]);
115+
}
116+
return Q();
117+
})
116118
.catch(function(ex) {
117119
if (ex instanceof Error) {
118120
log.error(ex);

lib/ionic/run.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,38 +80,41 @@ function run(ionic, argv, rawCliArguments) {
8080
hasBuildCommand = results[2];
8181
hasServeCommand = results[3];
8282

83-
if (hasBuildCommand && !(isLiveReload && hasServeCommand)) {
83+
if (hasBuildCommand) {
8484
return npmScripts.runIonicScript('build');
8585
}
8686
return Q();
87-
}).then(function() {
87+
})
88+
.then(function() {
8889

89-
if (isLiveReload && hasServeCommand) {
90+
if (isLiveReload && hasServeCommand && false) {
9091

9192
// using app-scripts and livereload is requested
9293
return ConfigXml.setConfigXml(process.cwd(), {
9394
devServer: serveUtil.getUrl(address, port)
94-
}).then(function() {
95-
isLiveReload = false;
96-
return npmScripts.runIonicScript('serve', ['-p', port, '--address', address]);
9795
});
9896
} else if (isLiveReload) {
9997

10098
// not an app-scripts project but the user wants livereload
10199
return cordovaUtils.setupLiveReload(argv, appDirectory);
102-
} else {
103-
104-
// ensure the content node was set back to its original
105-
return ConfigXml.setConfigXml(appDirectory, {
106-
resetContent: true,
107-
errorWhenNotFound: false
108-
});
109100
}
101+
102+
// ensure the content node was set back to its original
103+
return ConfigXml.setConfigXml(appDirectory, {
104+
resetContent: true,
105+
errorWhenNotFound: false
106+
});
110107
})
111108
.then(function(serveOptions) {
112109
var optionList = cordovaUtils.filterArgumentsForCordova(cmdName, argv, rawArgs);
113110
return cordovaUtils.execCordovaCommand(optionList, isLiveReload, serveOptions);
114111
})
112+
.then(function() {
113+
if (isLiveReload && hasServeCommand && false) {
114+
return npmScripts.runIonicScript('serve', ['-p', port, '--address', address]);
115+
}
116+
return Q();
117+
})
115118
.catch(function(ex) {
116119
if (ex instanceof Error) {
117120
log.error(ex);

0 commit comments

Comments
 (0)