This is a migrated thread and some comments may be shown as answers.

Excluding code from development or production release.

2 Answers 48 Views
HTML5, CSS, JavaScript
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mOpLin
Top achievements
Rank 1
mOpLin asked on 07 Aug 2015, 05:06 PM

Hi, I tried to find something on the forum, but haven't been lucky.

This is the question, is there a way to exclude html or js code from running on a production release?

 Example.

I have an html screen where, I am using some code to show app dev version, user id, and some other stuff.
But I want to exclude this from the production release.
Also I ha​ve a some code that validates the domains that may register to the app, and I am pragmatically including a domain for testing purposes, I would like to exclude this code from final release.

 Is there any code I can use to exclude this from final release some way or I have to clean code before each production release?

2 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 12 Aug 2015, 01:29 PM
Hi Pablo,

If I understand you correctly, you want to exclude code (for debugging purposes for example) from your release builds. Please, correct me if this is not so. If this is the case however, I am afraid there is no straight forward approach to accomplish it. However, you can check these documentation articles about:
- Managing Configuration-Specific Files
- Managing Environment Settings
and apply a solution around them. For example, if possible, you can wrap the unnecessary code in single files and exclude them for the release configuration. Or have an environment setting, for which to execute certain functions or not, depending on the build configuration.

Still, if this doesn't help, share a bit more specifics about your exact scenario and I will try to assist you further.

Regards,
Kaloyan
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
mOpLin
Top achievements
Rank 1
answered on 18 Aug 2015, 01:28 AM
It works, thank you
Tags
HTML5, CSS, JavaScript
Asked by
mOpLin
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
mOpLin
Top achievements
Rank 1
Share this question
or