Working on an Electron app and trying to get the various bsconfig.json
files working. For context: Electron has three completely separate scripts that run that define a running app: a “main” process that runs a node app, a “renderer” process that runs in a browser window, and a “preload” script that binds the two together. Most people who are used to something like TypeScript just treat these as three separate projects (they don’t directly depend on one another).
For ReScript, that seems to imply using the pinned dependencies feature to allow specifying that the renderer process depends on the main process to build. That’s not strictly true since the renderer process cannot actually call code from within the “main” process, but the “app” itself is really a function of all three of these parts.
Looking at the docs, I see an example of what the app/bsconfig.json
should look like, but no examples of the other config files. Also, if I do not have a /bsconfig.json
in my project it seems to fail when running npx rescript build
complaining that I’m missing that “top-level” bsconfig.json
even though the documentation doesn’t mention it at all. Can someone point me to maybe a repo of a working example or help me to flesh out how best to tackle this using pinned dependencies?
I’m also open to suggestions that I should not use pinned dependencies here and maybe there is a way to treat each sub-project as a proper “ReScript” project with no direct dependencies, that’s really all I need, but can’t figure out how to configure the rescript
CLI to understand the various subdirectories: it always keeps suggesting that I’m missing a bsconfig.json
in the shared “root”. Not sure how it determines where that location is.