Closed
Description
TypeScript Version: Version 3.8.3
Search Terms: json rootDir
Code
Folder structure:
src/test.ts
src/tsconfig.json
data/dummy.json
tsconfig:
{
"compilerOptions": {
"esModuleInterop": true,
"resolveJsonModule": true,
"rootDirs": [
".",
"../data"
]
}
}
test.ts:
import dummy from "./dummy.json"
console.log(dummy)
Expected behavior:
JSON printed to stdout.
Actual behavior:
The error: src/test.ts:1:19 - error TS6059: File 'repro/data/dummy.json' is not under 'rootDir' 'repro/src'. 'rootDir' is expected to contain all source files.
Playground Link:
Related Issues: