1. #1
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    13
    Answers
    1
    Vote Rating
    0
    remparauk is on a distinguished road

      0  

    Default Unanswered: Issue with custom javascript includes

    Unanswered: Issue with custom javascript includes


    I've some helper js files which I use in my app. It works fine in testing & debug mode. But during the production build, it is not included into the app.js. I'd to explicitly include it in the index.html as below. Any reasons why this is happening. Am I doing something wrong here.
    Code:
    "js": [
                {
                    "path": "sdk/sencha-touch.js"
                },
                {
                    "path":"app/util/Api.js",
                },
                {
                    "path":"app/util/Helpers.js",
                },       
                {
                    "path": "app.js",
                    "bundle": true,  
                },
            ],

    Code:
     
    <script  type="text/javascript" src="app/util/Helpers.js"></script>
        <script  type="text/javascript" src="app/util/Api.js"></script> 
        <!-- The line below must be kept intact for Sencha Command to build your application -->
        <script id="microloader" type="text/javascript" src="sdk/microloader/development.js"></script>

  2. #2
    Sencha User
    Join Date
    Aug 2012
    Posts
    18
    Answers
    2
    Vote Rating
    2
    gruese is on a distinguished road

      0  

    Default


    I have the same problem. Everything works in dev and in the "testing" and "package" builds, but the production build does not load the external js file, despite still having it correctly listed in its app.json.

    Is this a problem in the production microloader?

    EDIT: I am using 2.1.0-b2

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Answers
    3541
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    If they use the app namespace, why not just add them as required and then they will be part of the build?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #4
    Sencha User
    Join Date
    Aug 2012
    Posts
    18
    Answers
    2
    Vote Rating
    2
    gruese is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    If they use the app namespace, why not just add them as required and then they will be part of the build?
    They don't use the app namespace though, why would they if they are external?

  5. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Answers
    3541
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You put them in the app directory which should be used for app classes. I have util classes in my apps under the app namespace
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #6
    Sencha User
    Join Date
    Aug 2012
    Posts
    18
    Answers
    2
    Vote Rating
    2
    gruese is on a distinguished road

      0  

    Default


    I see, and thanks for the reply, but are we talking about external libraries here?

    The way I understand, you are talking about util classes that you write yourself, or did I misread?

Thread Participants: 2

Tags for this Thread