Let me explain my problem with following typescript-code (used for in the browser):
import Controller = require('./Controller');
class MainController extends Controller { ... }
export = MainController;
In this case it will load the Controller-class (from a different file) asynchronous using AMD and RequireJS. But why wouldn't this be bundled to just one JavaScript-file since it is uses the Controller-class directly. I believe that the asynchronous loading part is only relevant when the application is already bootstrapped with all relevant code and code that is required in runtime would be asynchronously loaded.
For example I have 100 files that all uses each other for bootstrapping the application. In case of performance wouldn't this just be bad practice since it would increase the amount of requests to 100, only to bootstrap the application?
Am I wrong at this part or what do you suggest?
You can use the RequireJS optimization tool to "...[combine] related scripts together into build layers and [minify] them via UglifyJS (the default) or Closure Compiler (an option when using Java)."