The last time I followed a discussion on this topic the conclusion was that TS will
guarantee the correct order of file1 and file2 in the output in regards to the class hierarchy.
The order is solely determined by the processing of
tags which can be tricky to unmanageable in more complex scenarios. See ticket
A common approach is to have a single file as entry-point for the compiler that defines all files in the project in the correct order via
tags. Individual files in the project all reference this 'master' file. (This approach is explained in more detail in the comments to the ticket linked above.)
I've read that Visual Studio has recently introduced a new behavior where all TS files in a project automatically reference each other. It would be interesting to hear from VS users whether VS will take care of the correct order when compiling to a single output
Not sure if there have been other changes in regards to the ordering issue in recent releases, maybe @jonturner can clarify.
Personally, I would like to see the TS team describe the recommended approach for a project setup that uses the pattern of one class per file, with the entire project being compiled into one output file.
After the recent changes in the compiler (cleanup of command line switches) and VS, I assume that this is not something that will be handled inside the compiler, but is rather expected to be dealt with on tool level. Again, I would appreciate the TS team commenting
hereon as well.