Results 1 to 2 of 2

Thread: Sencha CMD compiled file still downloading individual javascript files (touch 2.3.1)

  1. #1
    Sencha Premium User
    Join Date
    Oct 2014
    Posts
    3

    Default Sencha CMD compiled file still downloading individual javascript files (touch 2.3.1)

    Hi there, I have an existing Sencha Touch 2.3.1 MVC app that I want to compile to have a single concatenated javascript using Sencha CMD. With Sencha CMD I compiled out a bootstrap file and the single concatenated file that has all my javascript but when I run the app, I can see in Chrome inspector that the app is downloading individual javascript files.

    This is the line I am using to compile my existing app to one file (not compressed at this point):

    Code:
    sencha -sdk /path/touch-2.3.1/src compile --classpath=. --options=debug:false include --all and exclude --file=lib,one_file.js and concatenate --output-file=one_file.js
    This is what I am using to generate the bootstrap file:
    Code:
    sencha -sdk /path/touch-2.3.1/src compile -classpath=app meta -alias -out bootstrap.js and meta -alt -append -out bootstrap.js and meta -loader -append -base-path . -out bootstrap.js
    Here is how my app.js look like:

    Code:
    Ext.application({
        name: 'MyApp',
        appFolder: 'app',
        glossOnIcon: false,
        paths: {
            'MyApp.ux': './app/ux',
            'Ext.override': './app/override'
        },
        requires: [
            'MyApp.Config',
            'MyApp.File'
        ],
        viewport: {
            itemId: 'viewport'
        },
        stores: [
            'store1',
            'store2',
            // ...
            'store5'
        ],
        models: [
            'model1',
            'model2',
            //...
            'model5'
        ],
        views: [
            'MainContainer',
            'view1',
            'view2',
            //...
            'view9'
        ],
        controllers: [
            'MainController',
            'LoginController',
            'AnotherController'
        ],
        launch: function() {
            MyApp.app = this;
            Ext.create('MyApp.view.MainContainer', { fullscreen: true });
        }
    
    
    });
    And finally this is how my index.html looks like:

    HTML Code:
    <!DOCTYPE html><html><head>    <title>MyApp</title>
        <meta charset="utf-8"/>    <link rel="stylesheet" type="text/css" href="css/my-theme.css"/>    <link rel="stylesheet" type="text/css" href="style.css"/>
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="lib/touch2/sencha-touch-all-debug.js"></script>    <script type="text/javascript" src="one_file.js"></script></head><body></body></html>
    Your help will be highly appreciated. I spent many days to learn how to use Sencha CMD, got stuck at this point for a while. App runs fine but downloads individual javascript file.

  2. #2
    Sencha - Engineering israelroldan's Avatar
    Join Date
    Nov 2011
    Location
    The Netherlands
    Posts
    395

    Default

    Your app seems to be following the standard Cmd project structure, any particular reason why you're not using "sencha app build" instead?
    Israel Roldán | Senior Software Engineer (Framework tools)

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
  •