I worked with the "-out" compiler flag to create 1 javascript output file. I have many .ts files, and I managed this by putting this at the beginning of each file:
Now I really would like to use React.js in this project. And the only way to "use" the reaction correctly in Typescript (so that I can still create Typescript classes) seems to be using this react-typescript library
But this library is created using commonjs modules and using a browser to subsequently combine them into 1 file:
import React = require('react');
import ReactTypescript = require('react-typescript');
and in the project examples, all .ts files first list their local .ts dependencies using the many “required” calls at the top.
The thing is, when I added the "modjs" -module flag to the compiler command, the usual -out behavior stopped working because the link files were no longer included in the output. It seems that the compiler cannot use --out with --module, right?
So far, I’m not sure how to convert this “javascript module” of typescript reagent to an internal Typescript module. Therefore, it seems to me that the only way to continue is to change all my link tags to require calls. My quetion, if this is the right approach or is there another way?
Since I have so many files and so many dependencies, I am worried that all these calls require unnecessary complication of the final code and maybe even affect performance?