1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    410
    Vote Rating
    2
    parky128 is on a distinguished road

      0  

    Default Custom JS files are not getting bundled when packaging app

    Custom JS files are not getting bundled when packaging app


    Hi,

    I have some custom js files located in a 'lib' folder relative to my app.json file and have added these as includes in app.json as follows:

    Code:
    "js": [
            {
                "path": "touch/sencha-touch.js",
                "x-bootstrap": true
            },
            {
                "path": "lib/MarkerManager.js"
            },
            {
                "path": "lib/HistoryMarkerManager.js"
                
            },
            {
                "path": "lib/InfoBubble.js"
            },
            {
                "path": "lib/MarkerWithLabel.js"
            },
            
            {
                "path": "app.js",
                "bundle": true,  /* Indicates that all class dependencies are concatenated into this file when build */
                "update": "delta"
            }
        ],
    These all load in fine when I run the application locally in the browser in debug mode, so just straight from the app directory root on my machine.

    When I package up the application for Android via Architect and look at the 'build/package' folder in my project directory, I notice that the these js files are still present in a lib folder and have not been concatenated into the app.js file. They are also included as separate resources in the index.html file that gets built.

    How can I instruct the build process to include these files in the 'all' js file?

    It may be worth me mentioning that these files contain anonymous functions and are dependent on the Google Maps lib being loaded first, which I also have as a resource in my project as I use a map panel in my application.

    Do I need to use requires anywhere? I haven't been so far since its been working fine for me locally.

    Thanks

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,936
    Vote Rating
    130
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    Try adding the path to your lib folder in you apps .sencha/app/sencha.cfg to your app.classpath
    Code:
    app.classpath=${app.dir}/app.js,${app.dir}/app

Thread Participants: 1