rescript-vscode icon indicating copy to clipboard operation
rescript-vscode copied to clipboard

Consider using root rescript.json if nearest one does not have a setting.

Open fhammerschmidt opened this issue 10 months ago • 0 comments

If I have a monorepo:

.
├── common
│   ├── src
│   └── rescript.json
├── app
│   ├── src
│   └── rescript.json
└── rescript.json

and, in the root rescript.json, I set the suffix to something that is not the default, e.g.

{
  "package-specs": [
    {
      "module": "esmodule",
      "in-source": true,
      "suffix": ".res.mjs"
    }
  ],
}

the suffix resolution for opening the compiled JS file in both the common and app subprojects does not work, since the default is .js. One would need to add the suffix in the subproject's rescript.json as well.

The order of evaluation should be local > root > default fallback

fhammerschmidt avatar Feb 10 '25 14:02 fhammerschmidt