-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smarter contatenation based on import. #2032
Comments
We have followed an axiom not to reorder user code. So the compiler will honor input order. issue #21 is tracking issuing an error if the order is guaranteed to fail at run time, e.g. extends for an undefined class. The order of files in output is defined by order of files passed to the compiler on the command line. then by following any /// tags that are included in these files and any import statements.. To manage order you have a few options:
You can find more information about ordering files in the output in this issue #1066 |
This is another reason for supporting globs or similar (as mentioned in the previous issue #1516 (comment)). The minute we add one file to The solution of using a mix of That's just confusing. |
@NoelAbrahams i agree globs is a useful addition, i have filed #2154 for it. |
I'm compiling a number of .ts files and using the --out option to concatenate them into a single .js file. I've got some files in different folders, and using internal modules. Without <reference path=... to reference the .js, the compiler still finds the files just fine:
However, when it concatenates, It may place them in the wrong order (though it seems like files in the same folder are in the right order). Since it is basing that only on the reference path, which I did not include. As a result, I may get undefined when importing Widget. If the compiler is compiling a set of files, could it not use the import and module names to order the files appropriately? This would eliminate the need for the reference path, unless the thing being referenced is not part of the compile.
The text was updated successfully, but these errors were encountered: