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

    Default 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

    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 Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449
    Answers
    3997

    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
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  4. #4
    Sencha User
    Join Date
    Aug 2012
    Posts
    21
    Answers
    2

    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 Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449
    Answers
    3997

    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
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  6. #6
    Sencha User
    Join Date
    Aug 2012
    Posts
    21
    Answers
    2

    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
  •