-
21 Feb 2013 1:22 AM #1
How to create a custom build containing only the code that application needs?
How to create a custom build containing only the code that application needs?
Sencha Cmd how to create a custom build containing only the code that application needs?
I use sencha sdktool 2.0 create jsb3 file to build a custom build file,but use cmd ,i dont know how to do so. Cmd can build a final file but can not load other classes if there need .
-
21 Feb 2013 6:51 PM #2
-
25 Feb 2013 12:42 PM #3
I recently went though the same issue, it's not perfect but this should get you started. Hopefully you, or some people could offer some improvements. I kind of settled with "good enough" for the moment. The idea is to exclude everything that isn't your app:
Notes:Code:sencha compile page -name=page -in index.html -out ../dontuse.html and restore page and exclude -all and include -namespace MyApp and include -file "app/ux/**" and concat ../all-classes.js
- first I tried to just exclude the Ext namespace, but it turns out the framework also includes about 9k lines of code that doesn't fall into the Ext ns. So I ended up with a "exclude all, then add back in what i need" mindset.
- dontuse.html is because the output html assumes the extjs framework is minified with your code and isn't. You will need to make/maintain another html file that includes the framework before the rest of the includes.
- MyApp is the namespace of your application, it equates to something like Ext.create('MyApp.model.User').
- I have custom overrides and plugins in my app/ux folder that doesn't belong in my app's namespace so I need to include them.
- Finally: I never got this to include my app.js. I gave up and just include that (uncompressed) in my custom index.html .
-
26 Feb 2013 5:26 PM #4
Thank you very much!
This way is not suit for me.I want to include the normal classes in one file all-class.js and can load other classes in runtime.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote