Is it possible (and how) to remove unutilized widgets from Ext JS library?

拈花ヽ惹草 提交于 2019-12-14 04:04:48

问题


Ext JS base and widgets together offer me the solution I've been looking for. The Ext JS library is somewhat heavy w.r.t. conventional standards.

There are several widgets in the library that I am not using. So I want to know if it is possible to remove the corresponding code (of widgets not being used) from the ext-all.js ?

To put it in other words, is it possible to compose a master Java Script of Ext JS that comprises of only the widgets of my interest? If there is a way I'd love to know.


回答1:


Yes, though some of the components are easier to remove than others, as there are dependencies.

Use JSBuilder. http://www.extjs.com/products/jsbuilder/ You need Java to run it.

Then, in the extjs distribution there is a file in each branch named "ext.jsb2", which is the JSBuilder project file.

Copy that file to something like "ext-custom.jsb2", then carefully remove components you don't need, then run a command like this:

java -jar JSBuilder2.jar --projectFile C:\extjs\branches\ext-3.1.x\ext-custom.jsb2 --homeDir C:\ext-custom

The output will be in the custom directory, and you'll have ext-all.js, etc. with just your stuff.




回答2:


Yes, it is possible. That tool is available on their site. JSBuild2 is created by ExtJS team for that purpose. You just edit ext.jsb2 file appropriately.

There is an old page and a forum thread.



来源:https://stackoverflow.com/questions/2456266/is-it-possible-and-how-to-remove-unutilized-widgets-from-ext-js-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!