-
12 Sep 2012 9:05 AM #1
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
-
13 Sep 2012 12:59 PM #2
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:
HTH!Code:document.write('<script src="config.js" type="text/javascript" charset="utf-8"><'+'/'+'script>');
Milton
-
16 Sep 2012 11:37 AM #3
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); } });
-
16 Sep 2012 1:16 PM #4
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


Reply With Quote