There seems to be an issue with the functionality of tsconfig.json inheritance, specifically regarding the proper inheritance of the "typeRoots" setting.
http://www.typescriptlang.org/docs/handbook/tsconfig-json.html
(folder structure provided below)
web.site -> tsconfig.json
- typings
- node_modules
- scripts
- ts
- tests
- ts -> tsconfig.json (this tsconfig extends/inherits web.site - see contents below)
Running the tsc command in the web.site folder successfully compiles due to the correct usage of the typeRoots setting.
However, running the tsc command in the tests folder results in compilation errors as it fails to locate references in the "typings" folder which it should based on the inherited typeRoots settings.
Moving the failing file from the tests folder to the root web.site directory allows for successful compilation, indicating a problem with how tsconfig.json is being utilized.
Considering the issues with inheritance, would it be better to abandon it and use separate tsconfigs instead?
tsconfig.json in web.site:
{
"compileOnSave": true,
"compilerOptions": {
"listFiles": true,
"removeComments": true,
"sourceMap": true,
"module": "es6",
"moduleResolution": "classic",
"outDir": "scripts/js",
"typeRoots": [
"node_modules/@types",
"typings"
]
},
"include":[
"scripts/ts/**/*"
]
tsconfig.json in tests:
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "js",
"removeComments": false
},
"include": [
"ts/**/*"
]
}