Hey all,
I’ve been trying to set up a ReScript project inside a monorepo powered by nx.dev.
I tried setting up a bsconfig.json
{
"sources": [],
"bs-dependencies": ["./libs/feature1"]
}
And then another bsconfig.json in the ./libs/feature1
directory
{
name: "@app/feature1",
sources: [{dir: "src", subdirs: true}, {dir: "test", subdirs: true, type: "dev"}]
}
This did not work as intended
File "bsconfig.json", line 1
Error: package ./libs/feature1 not found or built
- Did you install it?
- If you did, did you run `rescript build -with-deps`?
So I thought to myself. What if I’m a bit cheeky and use a ..
in the bs-dependencies. So I changed it to ../libs/feature1
This got me a bit further
File "/Users/user/path/to/repo/node_modules/../libs/feature1/bsconfig.json", line 2:
Error: package name is expected to be ../libs/feature1 but got @app/feature1
With this context I want to ask why bs-dependencies have to be in node_modules? Is it possible to change the system such that bs-dependencies take a Map instead of a list?
for this use case I could create something like:
{
"bs-dependencies": {
"@app/feature1": "./libs/feature1"
}
}
This would be a ReScript analog to the tsconfig.json
paths
property