Results 1 to 3 of 3

Thread: Including vendor libraries in build

  1. #1
    Sencha User
    Join Date
    Jul 2013
    Posts
    9

    Default Including vendor libraries in build

    I'm new to Sencha Cmd and I'm trying to solve something that probably has a simple solution out there, but I'm just not finding it.

    I need to include several 3rd party libraries into my Ext-JS 4 application - jQuery, Underscore, FlexPaper and eventually others. I've managed it so far by adding links into my index page outside of the bootstrap and compile sections, with each of the necessary files living in the resources directory - which seem to be automatically copied into the build directory.

    I'm betting there is a much better way, some method to specify scripts to preload - ideally to be included in a single, minified file (as a part of 'all-classes.js..?). I'd love to be able to do something like populate an array of required libraries and have 'sencha app build' include them all in such a way that they are available when my app launches. Can someone recommend best practice for this? Thanks in advance for any insight.

  2. #2
    Sencha Premium User varsos's Avatar
    Join Date
    Feb 2008
    Location
    Long Island, NY
    Posts
    367

    Default

    Try adding the paths to the JS files in the sencha.cfg file
    There is a property called app.classpath, for comma delimited paths

    If your external libs are accessible in your project, supply the paths and the code will be included in th classes-all.js
    varsos

  3. #3
    Sencha User
    Join Date
    Jul 2013
    Posts
    9

    Default

    Thanks so much for the reply, varsos. It isn't working for me yet and I'm not sure why. I've tried to just add in the flexpaper library for now, keeping it simple. I've modified the classpath in sencha.cfg to include the path to it's source files:

    Code:
    # The path(s) to application javascript sources (comma separated)
    app.classpath=${app.dir}/app,${app.dir}/lib/flexpaper/js
    I moved the script tags for the flexpaper libraries into the bootstrap section of the index page, so that they are not included into the index page of the built application - which occurs as expected.

    Then, I head to the command line and run 'sencha app build'. In the output, I do see this line included as it executes the build:

    Code:
    [INF] Loading classpath entry /Applications/XAMPP/xamppfiles/htdocs/savanna/src/public/lib/flexpaper/js
    Unfortunately, when I then launch the application in the build directory the library flexpaper is undefined and sure enough, the all-classes.js file remains the same size - both with and without the included classpath. Is there another step I need to take - maybe another place to specify the path..? Thanks again for any assistance.

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
  •