Project reference root resolve.
Resolve project reference paths from root directory of a mono repository.
We have a large mono-repository with 1000s of sub-packages we want to convert to TS projects. Currently the references between them must be defined as relative paths, leading to configuration like:
"references": [
{
"path": "../../../base"
},
{
"path": "../colors"
},
{
"path": "../device_capabilities"
}
],
Which is:
Ideally project references could be resolved from the root of the mono-repo project, e.g. rootDir or baseUrl options.
E.g.:
"references": [
{
"path": "base"
},
{
"path": "ui/base/colors"
},
{
"path": "ui/base/device_capabilities"
}
],
My suggestion meets these guidelines:
To be consistent with current standards for relative to root, would it be better to prefix these references with "/"?:
...
"references": [
{
"path": "/base"
},
{
"path": "/ui/base/colors"
},
{
"path": "/ui/base/device_capabilities"
}
],
...
https://www.typescriptlang.org/docs/handbook/module-resolution.html
Most helpful comment
To be consistent with current standards for relative to root, would it be better to prefix these references with "/"?:
https://www.typescriptlang.org/docs/handbook/module-resolution.html