I started learning how to build mobile apps using the ionic framework.
I do see people using ionic build and others use cordova build.
I will like to know the difference between the two and when to use them.
They are the same. (emphasis added)
The
build
command builds an app for a specific platform. Pass in eitherios
orandroid
to generate platform specific code in the platforms subdirectory.The
build
command is a proxy for Cordova’sbuild
command.
Ionic | build
CLI
Looking at the code https://github.com/driftyco/ionic-cli/blob/master/lib/ionic/cordova.js ionic build and cordova build seems to be the same. No conditionals set for 'build' command there. Building command requires platform so it sets isPlatformCmd within the code, but it is used only with 'add' or 'remove' commands.
So the only difference for the 'build' seems to be returning success return code no matter how internally executed cordova ends.
.then(function() {
return self.runCordova(cmdName, argv);
})
.then(function(runCode) {
//We dont want to do anything if the cordova command failed
if(runCode !== 0 || argv.nosave) {
return
}
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With