If I were to transition to using RequireJS, would this mean that I could get rid of the single JS file?
Not necessarily. Even with RequireJS, you still have the option to output everything into a single file. When configuring TypeScript to generate AMD modules, you can choose to produce either individual files for each module or a bundled file containing all modules. The decision on how to organize your files depends on the specific needs and structure of your project.
In my experience with AMD projects, I preferred to have TypeScript output individual files and then leverage tools like r.js
or Webpack to bundle them. However, there may be cases where letting TypeScript handle the bundling process itself is a suitable choice. It ultimately comes down to the requirements of your project.
Is it true that RequireJS loads JS file references at run-time?
Yes, RequireJS does load file references at run-time, but it doesn't dictate how you should organize your project's modules during run-time. It is common practice to bundle related modules together to reduce the number of HTTP requests made to the server. The way you bundle modules should align with the structure and dependencies of your project.