I’ve been thinking about using ReScript in my TypeScript based project. I would like to use Gentype to generate TypeScript files from the ReScript ones, but I couldn’t find a way to disable JavaScript.
Can you configure the build process to only output TypeScript?
It doesn’t work that way. The JavaScript is always produced and then there is a thin TypeScript file that mostly adds type annotations to the JavaScript. It should work fine. I’ve used it and have no problems importing the types and functions I need from the TypeScript file.
There is talk about changing GenType to output .d.ts files so it doesn’t introduce any run time differences or overhead between the JavaScript and TypeScript. I haven’t heard about proposals to emit TypeScript instead of JavaScript.
My problem is somewhat related. My .bs.js includes the JavaScript version of my ReScript functions, but gentype seems to be adding wrappers around the JavaScript functions and using a curry helper. Very puzzling.
I would rather have just one .bs.js file OR the .gen.tsx file.