Excluding code from development or production release.

Thread is closed for posting
3 posts, 0 answers
  1. Pablo
    Pablo avatar
    32 posts
    Member since:
    Feb 2015

    Posted 07 Aug 2015 Link to this post

    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?


    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. Kaloyan
    Kaloyan avatar
    878 posts

    Posted 12 Aug 2015 Link to this post

    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.


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

  3. Pablo
    Pablo avatar
    32 posts
    Member since:
    Feb 2015

    Posted 17 Aug 2015 in reply to Kaloyan Link to this post

    It works, thank you
Back to Top