awesome-typescript-loader
awesome-typescript-loader copied to clipboard
strange behaviour with 'extends' option at tsconfig.json
{
"compilerOptions": {
"jsx": "react",
"outDir": "../../dist/web",
"paths": {
"web/*": ["../web/*"],
"shared/*": ["../shared/*"]
}
},
"extends": "../../tsconfig.base"
}
with ATL I see errors about files that must be invisible (e.g. TSC/ts-loader works as supposed).
I have found that TsConfigPathsPlugin does not resolve all the "extends" parent properties
Say if you have these configuration files
tsconfig.base.json
{
"compilerOptions": {
"baseUrl": "node_modules"
}
}
tsconfig.json
{
"extends": "./tsconfig-base.json",
}
Then this throws errors
resolve: {
plugins: [
new TsConfigPathsPlugin({
context: path.resolve("./"),
tsconfig: path.resolve("./tsconfig.json"),
configFileName: path.resolve("./tsconfig.json"),
})
]
},
This works, however you miss any props you may have had in tsconfig.json (may be acceptable)
resolve: {
plugins: [
new TsConfigPathsPlugin({
context: path.resolve("./"),
tsconfig: path.resolve("./tsconfig-base.json"),
configFileName: path.resolve("./tsconfig-base.json"),
})
]
},
Or can just do
resolve: {
plugins: [
new TsConfigPathsPlugin({
context: path.resolve("./"),
"baseUrl": "node_modules",
})
]
},
I've having also an issue that ATL doesn't honor tsconfig's "extends" property, and so my "baseUrl" and "paths" properties of my custom tsconfig.project.json (that extends a tsconfig.json) don't get resolved.
ATL v3.2.2 TypeScript v2.4.2 Webpack v3.4.1
I have the same problem. Impossible to use "extends" in tsconfig with ATL!
+1