1. #1
    Sencha Premium Member
    Join Date
    Jul 2011
    Posts
    4
    Vote Rating
    0
    tpolyak is on a distinguished road

      0  

    Default Unanswered: Exclude files from Sencha build process

    Unanswered: Exclude files from Sencha build process


    Hello everyone,

    Is it possible to exclude some JS files from the concatenation / minification process during build?
    I have a config.js file containing some URLs, it would be very useful if I could edit it without the need of rebuilding / redeploying the whole application.

    So after building the application I would like to have these three js files:
    - sdk/sencha-touch.js (minified, saved in localstorage after the first download)
    - app.js (concatenated, minified, saved in localstorage after the first download)
    - config.js (untouched, don't save in the localstorage)

    Thank you for your help,
    Tamás

  2. #2
    Sencha User
    Join Date
    Nov 2009
    Location
    Uruguay
    Posts
    47
    Vote Rating
    0
    milton9480 is on a distinguished road

      0  

    Default


    Hi tpolyak!

    You should remove it from app.json file. This way, the file wont be considered in the build.
    Then you have to copy the config.js file to the build folder and update one of your files (says your original app.js file) to request the script dinamically, including something like:
    Code:
    document.write('<script src="config.js" type="text/javascript" charset="utf-8"><'+'/'+'script>');
    HTH!
    Milton

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2011
    Posts
    4
    Vote Rating
    0
    tpolyak is on a distinguished road

      0  

    Default


    The problem is that config.js is part of the project (it's a Sencha class), so it gets appended to app.js.

    The file looks like this:
    Code:
    Ext.define('MyApp.utils.Config', {
        singleton : true,
    
    
        config : {
            authBaseUrl : '...',
            serviceBaseUrl : '...',
            reportsBaseUrl : '...',
            imagesUrl : '...'
        },
    
    
        constructor : function (config) {
            this.initConfig(config);
        }
    });

  4. #4
    Sencha User
    Join Date
    Nov 2009
    Location
    Uruguay
    Posts
    47
    Vote Rating
    0
    milton9480 is on a distinguished road

      0  

    Default


    Ok, let's see. Is that file in your app.json ?
    Sencha append to app.js those files that are defined in the app.json file. So if you remove from there, Sencha won't append to the app.js. Of course you wont be able to access it, but if you load it dinamically, you will get it.

    HTH,
    Milton

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi