Search code examples
typescripttsconfig

Is it possible to use tsconfig `paths` with a (project) `reference`?


I am making use of project references in a typescript project, and was wondering if this will work with paths?

Essentially this would entail creating a named path for a directory outside of the rootDir. Has anyone seen this done? Or do you perhaps have direct knowledge that it cannot be done?

TIA


Solution

  • As soon as I posted my question, I fiddled with the path a bit more and it "just worked."

    Here's the relevant code:

    "compilerOptions": {
      "paths": {
         "@src/*": ["../src/*"],
       },
    },
    "references": [
      { "path": "../" }
    ],