Results 1 to 6 of 6

Thread: Issue with custom javascript includes

  1. #1
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    13
    Answers
    1
    Vote Rating
    0
      0  

    Default 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
    21
    Answers
    2
    Vote Rating
    2
      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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,411
    Answers
    3898
    Vote Rating
    1290
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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
    21
    Answers
    2
    Vote Rating
    2
      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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,411
    Answers
    3898
    Vote Rating
    1290
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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
    21
    Answers
    2
    Vote Rating
    2
      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?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •