diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 04a4d3b555..410f54641d 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -977,10 +977,7 @@ on an OS X system."); buildmessage.enterJob( { title: `building Cordova app for \ ${cordova.displayNameForPlatform(platform)}` }, () => { - let buildOptions = []; - if (!options.debug) { - buildOptions.push('--release'); - } + let buildOptions = { release: !options.debug }; cordovaProject.buildForPlatform(platform, buildOptions); const buildPath = files.pathJoin( diff --git a/tools/cordova/project.js b/tools/cordova/project.js index ae30b37570..50620ec07a 100644 --- a/tools/cordova/project.js +++ b/tools/cordova/project.js @@ -185,7 +185,7 @@ ${displayNameForPlatform(platform)}`, async () => { // Building (includes prepare) - buildForPlatform(platform, options = [], extraPaths) { + buildForPlatform(platform, options = {}, extraPaths) { assert(platform); const commandOptions = _.extend(this.defaultOptions,