We have some legacy code which does not follow MVC at all (many classes in the same file, Ext.define, requires not used etc) we need to extend this application and want to use MVC for the new code and gradually refactor legacy code. Thus we need to be able to have a MVC compliant packaging of new code (consolidated file muct include individual classes in correct order) separate from Ext library code separate from legacy code so it can be included in following order

- ext
- legacy
- new MVC compliant code

I am new to cmd and could not figure out how to do it. I was reading compile docs and did not find any way to tell it to only include my application classes into the output file because I intend to use ext-all

I would greatly appreciate your advise
Alex

26 Jan 2013, 4:29 PM

dongryphon

Do you need these in separate concatenated outputs or would it suffice to get them in the right order and still have a single file?

If the latter is workable for you, and if you can use the page compile command, here is a way to do it:

The above will tell the compiler about the legacy files and their order with respect to each other (the compiler will inject dependencies between each script tag to preserve this).

To ensure that the framework comes before the legacy files, you can add something like this to the first one:

Code:

//@require Ext.grid.*

Or you can put that one line in a new script and place it before the first legacy file. If you need several such directives to declare what you need (vs "Ext.*") then the new file may be easy to reuse across pages.

If you cannot use the page compile command, it will help to know how you currently handle load order of your legacy files.

The low-level commands to do this kind of thing are discussed in http://docs.sencha.com/ext-js/4-1/#!...mand_app_multi in the "Alternative Strategy - Sharing A Framework Subset" section. If you need to drop the page commands, you can still bring in the JS files by adding the folders to the classpath. That is mostly what the page command does behind the scenes (that and it performs the dependency scan / recursive union on the files directly used by the page but that is also achievable without the page command).