How can I transpile Typescript without using the command line?
I want to have a script build.js that will build my application.
So far, I found that the typescript package has a transpile(inputArgument, compileOptions) method, but I couldn't find anything about this on their documentation.
I can have my project built using tsc -p server, so I imagined the following would work:
const tsc = require('typescript');
tsc.transpile("", {
project: "server",
});
Then I'd use node build.js.
I couldn't get the tsc.transpile() to work (I couldn't figure out what the inputArgument was) and I couldn't find on their documentation how to do this: transpile from code, without the CLI.