How to include code for a debug build?


#1

Hello all,
Part of my code is for debugging purpose that is not needed in the release build.
Is there an option to identify which build is taking place (debug Vs. release ) and ignore/disable part of the code?

Thank you,
Roye


#2

See: https://github.com/ionic-team/ionic-app-scripts

IONIC_ENV	Value can be either prod or dev.

For example:

const env = process.env.IONIC_ENV;

if (env === 'prod') {
  ...
}

See: https://robferguson.org/blog/2017/09/09/a-simple-logging-service-for-angular-4/


How to ignore assets file on build
#3

Than you for quick respond.
I’ll do the reading.