# How to include code for a debug build?

**URL:** <https://forum.ionicframework.com/t/how-to-include-code-for-a-debug-build/129467>\
**Category:** ionic-v3\
**Created:** [May 2, 2018, 1:52am UTC](https://forum.ionicframework.com/t/how-to-include-code-for-a-debug-build/129467 "2018-05-02T01:52:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roye](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/roye/32/119133_2.png) [@Roye](https://forum.ionicframework.com/u/Roye)\
**Post date:** [May 2, 2018, 1:52am UTC](https://forum.ionicframework.com/t/how-to-include-code-for-a-debug-build/129467/1 "2018-05-02T01:52:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![robinyo](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/robinyo/32/115964_2.png) [@robinyo](https://forum.ionicframework.com/u/robinyo)\
**Post date:** [May 2, 2018, 1:55am UTC](https://forum.ionicframework.com/t/how-to-include-code-for-a-debug-build/129467/2 "2018-05-02T01:55:20Z")

</div>

See: [https://github.com/ionic-team/ionic-app-scripts](https://github.com/ionic-team/ionic-app-scripts)

```auto
IONIC_ENV	Value can be either prod or dev.

```

For example:

```auto
const env = process.env.IONIC_ENV;

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

```

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

---

<div class="post-metadata">

**Author:** ![Roye](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/roye/32/119133_2.png) [@Roye](https://forum.ionicframework.com/u/Roye)\
**Post date:** [May 2, 2018, 2:12am UTC](https://forum.ionicframework.com/t/how-to-include-code-for-a-debug-build/129467/3 "2018-05-02T02:12:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:37pm UTC](https://forum.ionicframework.com/t/how-to-include-code-for-a-debug-build/129467/4 "2021-07-19T21:37:26Z")

</div>


