I see this question, but it is slightly different and has no answers
I have a couple of git submodules. They are large existing projects, and I thought I could just reuse pieces directly like:
myproject/
src/
submod1/src
submod2/src
with tsconfig.json like
<snip...>
"rootDir": "src/",
"outDir": "./dist",
"paths": {
"@submod1/*": [ "submod1/src/*" ],
"@submod1/*": [ "submod2/src/*" ],
"@app/*": [ "src/*" ]
},
And in my code things like
import { SomeVar } from '@submod1/constants';
But vscode (and tsc presumably) are reporting
File '<path>/submod1/src/index.ts' is not under 'rootDir' '<path>/src'. 'rootDir' is expected to contain all source files.
I'm just trying to do something simple and pragmatic. Is there a way to achieve this? I guess I could do something with symlinks, but that seems like a big mistake. I could put the submodules under src/ but that also seems wrong.