Skip to content
Advertisement

How do I transpile TypeScript to JavaScript with Yarn?

How do I transpile TypeScript code in JavaScript in a project managed by Yarn?

I need Javascript code in order to run it with other compilers (such as GraalVM) and investigate performance.

Advertisement

Answer

You can do it by adding a build rule to your package.json.

JavaScript

Replace . with the path to your tsconfig.json file which, for example, contains the following lines.

JavaScript

Run yarn run build.

The transpiled JavaScript files will be in the ./dist directory.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement