How to build all code in special folder?

I am working on my project with React and sometimes it’s not comfortable to have *.bs.js next to *.res files and I would like to move these *.bs.js files in some directory.

For example:
src/* - my code in rescript.

bsfiles/* - compiled files.

Is there any solution?

Yes, the configuration is documented here: Build System Configuration | ReScript Language Manual

"in-source": true generates output alongside source files. If you omit it, it’ll generate the artifacts into lib/js. The output directory is not configurable otherwise.


Does that allow to configure the target output folder? Some frameworks (like next-js) need some files to be on specific folders to process them properly.

If you use VSCode, you can visually hide the generated files from the bar File nesting in VS Code - DEV Community 👩‍💻👨‍💻

1 Like

No, it’s specifically in that folder only.

Out of curiosity, how do you have all these docs on hand? Are you a rescript developer, documentation writer, have a photographic memory, better search engine than the rest of us, or … ?

None of the above, I’ve just been interested in ReScript since 2016 (back then it was called BuckleScript, but you get the point).