Reputation: 271
Is there a way to tell in javascript, whether the running code is a debug or release build. This could facilitate constructs such as:
if (DEBUG) console.log("blah blah");
Upvotes: 4
Views: 1146
Reputation: 2361
You can use the cordova module cordova-plugin-is-debug
.
To add the plugin:
cordova plugin add cordova-plugin-is-debug
To find if in debug mode:
cordova.plugins.IsDebug.getIsDebug(function(isDebug) {
console.log("blah blah");
}, function(err) {
console.error(err);
});
Upvotes: 4