I've created an application using Ext JS 4. controllers
property in my app.js
contains only the main controller:
Ext.application({
name: 'MyApp',
appFolder: 'app',
controllers: [
"main.App"
],
loadController: function(controller) {
var oController = this.getController(controller);
oController.init(this);
oController.onLaunch(this);
}
});
MyApp.main.App
controller loads additional controllers by name using getController() approach (see loadController() method). These controllers are loaded dynamically and are not listed in my index.html
file.
In order to generate production version for deployment to server I am using Sencha Cmd by issuing the following command in my application folder:
sencha app build
Tool finishes normally and compresses all files into one big all-classes.js. The problem is that my dynamically loaded controllers are not included in that file.
Which is the correct way to make dynamically loaded controllers (over 100 in total) to be minified and processed by Sencha Cmd?
I know, that I can list them in my app.js
, or include in some file using Ext.require
, but I am seeking for correct approach for including over than 100 different controllers, views, models and stores automatically in my build. I believe that are other users of Ext JS, which are creating large-scale applications and are building somehow and I'll be grateful for any suggestions or just success stories
, which will help me to find the correct way to build.
uses
. It can be useful. But that way all my controllers will be included via a hugeuses
array. And that not only makes development more complicated (each time, when adding a new controller, one should also add it intouses
section), but also puts all controllers intoall-classes.js
, which make dynamic controller loading absolute (why to load dynamically, if controller is already downloaded and is available with all remaining stuff inall-classes.js
?) – Backplate