Results 1 to 6 of 6

Thread: Cannot get Ext requirements file only

  1. #1
    Sencha User
    Join Date
    Oct 2009
    Location
    Portland OR
    Posts
    10

    Default Cannot get Ext requirements file only

    Hi,
    I am trying to create a minified file with just the Ext components required by my application. Here is the command I am running:

    Code:
    $ sencha -sdk lib/extjs/  compile -classpath=src exclude -not -namespace Ext and -debug=false concat -yui build/test.js
    I have also tried these:

    Code:
    $ sencha compile -classpath=lib/extjs/src,src exclude -not -namespace Ext and -debug=false concat -yui build/test.js
    $ sencha compile -classpath=lib/extjs/src,src union -namespace Ext and -debug=false concat -yui build/test.js
    The issue is that the test.js file created contains everything in Ext, 1.4 MB. The app doesn't use nearly that much. I must be missing something here.... Thoughts?

    Thanks!
    Joshua

    Here is the directory structure:

    Code:
    ??? build
    ?   ??? test.js
    
    ??? lib
    ?   ??? JSCover/
    ?   ??? closure-library/
    ?   ??? crossroads/
    ?   ??? extjs/
    ?   ??? handlebars/
    
    ??? src
    ?   ??? app.js
    ?   ??? app/
    ?   ??? index.html
    ?   ??? login.html
    ?   ??? login.js
    ?   ??? resources/

  2. #2
    Sencha User
    Join Date
    Oct 2009
    Location
    Portland OR
    Posts
    10

    Default

    I forgot to add the version: Sencha Cmd v3.1.2.342

  3. #3
    Sencha User
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    You'll need to exclude all, include all files required by your app.js / login.js, and then exclude from that set all of the non-Ext files.

    Try with:
    sencha -sdk lib/extjs/ compile -classpath=src exclude -all and include -recursive -file=app.js,login.js and exclude -not -namespace Ext and -debug=false concat -yui build/test.js

  4. #4
    Sencha User
    Join Date
    Oct 2009
    Location
    Portland OR
    Posts
    10

    Default

    Unfortunately this command doesn't give me anything. The test.js file is 0 bytes. Could it be because the application is not set up as it would be if I ran the

    Code:
    sencha generate app
    command? We are not using Ext for anything except the views and a couple models here and there.

    Edit: I also have the debug output for the command but it is too big to upload.

    Quote Originally Posted by slemmon View Post
    You'll need to exclude all, include all files required by your app.js / login.js, and then exclude from that set all of the non-Ext files.

    Try with:
    sencha -sdk lib/extjs/ compile -classpath=src exclude -all and include -recursive -file=app.js,login.js and exclude -not -namespace Ext and -debug=false concat -yui build/test.js

  5. #5
    Sencha User
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    If you run the app in dev and include in the index.html file the ext-dev.js lib file do you get any synchronous load warnings in the console of the browser's dev tools? Want to make sure the necessary files are 'required' by the app to ensure that the Cmd compiler finds them when it's trying to compile the test.js output.

  6. #6
    Sencha User
    Join Date
    Oct 2009
    Location
    Portland OR
    Posts
    10

    Default

    My issues were resolved with these changes:

    1 - Changed all Ext.syncRequire to Ext.require (Ext.syncRequire is not currently supported with Sencha Cmd)

    note: I eventually changed the requires to use the following paradigm.
    Code:
    Ext.application({    name: 'MyApp',
        requires: [
            'Ext.fx.Easing',
            'Ext.fx.Anim',
            'Ext.panel.Panel',
            'Ext.tip.Tip',
            'Ext.tip.ToolTip',
            'Ext.tip.QuickTip',
            'Ext.panel.Table',
            'Ext.tip.QuickTipManager',
            'Ext.form.Basic',
            'Ext.window.Window',
            'Ext.window.MessageBox',
            'Ext.layout.container.Column',
            'Ext.form.Basic',
            'Ext.data.association.*'
        ],
        launch: function() {
    2 - I basically used the command slemmon suggested (thanks Seth!)
    Code:
    sencha -sdk lib/extjs/ compile -classpath=src exclude -all and include -recursive -file=app.js,login.js and exclude -not -namespace Ext and -debug=false concat -yui build/test.js

Posting Permissions

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