1. #1
    Sencha - Architect Dev Team
    Join Date
    Jan 2009
    Location
    Frederick, Maryland
    Posts
    901
    Vote Rating
    32
    jminnick has a spectacular aura about jminnick has a spectacular aura about

      0  

    Default Sencha Cmd v3.0.0.141 Build Process

    Sencha Cmd v3.0.0.141 Build Process


    SDK: ExtJS 4.1.1a
    Platform: Windows x64

    I make it through the entire build process executing the following command:

    sencha app build
    My pre-build index.html looks like so:

    HTML Code:
    <!DOCTYPE HTML>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>metrics_cmd_extjs</title>
        <link rel="stylesheet" href="resources/css/default/app.css">
        <link rel="stylesheet" href="resources/css/default/metrics.css">
        <link rel="stylesheet" type="text/css" href="ext/examples/ux/css/CheckHeader.css">
        <!-- <x-compile> -->
            <!-- <x-bootstrap> -->
                <script src="ext/ext-debug.js"></script>
                <script src="bootstrap.js"></script>               
            <!-- </x-bootstrap> -->
            <script src="app/app.js"></script>
        <!-- </x-compile> -->
    </head>
        <body>
            <div id="logo"></div>
            <div id="loadingapp">Please wait...</div>
        </body>
    </html>
    My build index.html looks like this:

    HTML Code:
    <!DOCTYPE HTML>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>metrics_cmd_extjs</title>
        <link rel="stylesheet" href="resources/css/default/app.css">
        <link rel="stylesheet" href="resources/css/default/metrics.css">
    <script type="text/javascript" src="all-classes.js"></script>
    </head>
        <body>
            <div id="logo"></div>
            <div id="loadingapp">Please wait...</div>
        </body>
    </html>
    I receive the following error in Chrome:

    Uncaught TypeError: Cannot call method 'define' of undefined
    Obviously the error is happening in the [build] produced file "all-classes.js"

    HTML Code:
    Ext.define("Ext.data.ResultSet"......
    It seems to me there is a file not being included in my build index.html that defines Ext. Am I missing something here?

  2. #2
    Sencha - Architect Dev Team
    Join Date
    Jan 2009
    Location
    Frederick, Maryland
    Posts
    901
    Vote Rating
    32
    jminnick has a spectacular aura about jminnick has a spectacular aura about

      0  

    Default


    If I run the skelaton app (the one produced by the generate command) through the build process this is what first appears in all-classes.js:

    HTML Code:
    var Ext=Ext||{};
    When I run my app through the build process, this is what appears first in all-classes.js prior to Ext being set:

    HTML Code:
    Ext.define("Ext.data.ResultSet",{loaded:true,count:0,total:0,success:false,constructor:function(a){Ext.apply(this,a);this.totalRecords=this.total;if(a.count===undefined){this.count=this.records.length}}});

  3. #3
    Sencha Premium Member
    Join Date
    Jun 2012
    Location
    Boston, MA
    Posts
    44
    Vote Rating
    3
    chrisfarrell is on a distinguished road

      0  

    Default index prep

    index prep


    Are we supposed to modify index.html prior to running a build?

    For example, are we supposed to replace 'ext-debug.js' with 'ext-all.js' or something like that?

  4. #4
    Sencha - Architect Dev Team
    Join Date
    Jan 2009
    Location
    Frederick, Maryland
    Posts
    901
    Vote Rating
    32
    jminnick has a spectacular aura about jminnick has a spectacular aura about

      0  

  5. #5
    Sencha - Architect Dev Team
    Join Date
    Jan 2009
    Location
    Frederick, Maryland
    Posts
    901
    Vote Rating
    32
    jminnick has a spectacular aura about jminnick has a spectacular aura about

      0  

    Default


    Quote Originally Posted by chrisfarrell View Post
    Are we supposed to modify index.html prior to running a build?

    For example, are we supposed to replace 'ext-debug.js' with 'ext-all.js' or something like that?
    Nope. I'm pretty sure the file included for your development work has no implications on the build process.

  6. #6
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,405
    Vote Rating
    149
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    Quote Originally Posted by chrisfarrell View Post
    Are we supposed to modify index.html prior to running a build?

    For example, are we supposed to replace 'ext-debug.js' with 'ext-all.js' or something like that?
    This is discussed in http://docs.sencha.com/ext-js/4-1/#!...and_app_single but in short, the index.html should not need to be edited unless you are dealing with 3rd party sources that don't work as simple add-ons to your classpath. See also http://www.sencha.com/forum/showthre...ndor-libraries

    The compiler will process everything inside the "x-compile" section. It removes and does not parse the nested "x-bootstrap" section. If you need code that cannot be combined in to your "all-classes.js", this can be placed outside the "x-compile" block.

    I hope that helps clarify this a bit.
    Don Griffin
    Engineering Manager - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

Thread Participants: 2