Hello,
I don't know if it's intentional or not but given this structure:
* base.tsconfig.json
* aFolder/
* tsconfig.json (extends base.tsconfig.json)
Actual behavior:
Now running tsc in aFolder:
base.tsconfig.json defined as ./dist it will create the dist folder in the root folder* base.tsconfig.json
* aFolder/
* tsconfig.json (extends base.tsconfig.json)
* dist/
aFolder/tsconfig.json defined as ./dist it will create the dist folder under the aFolder* base.tsconfig.json
* aFolder/
* tsconfig.json (extends base.tsconfig.json)
* dist/
outDir files are output in the aFolder folderExpected behavior:
I would expect the dist folder to be created relatively to the path of the main tsconfig used by typescript (here tsconfig.json) regardless if outDir has been specified in the parent or child tsconfig.json
File paths are relative to the containing tsconfig.jon file location.
@mhegazy thanks for the comment.
I understand, though using the extend keyword I would expect the relative path to be relative to the child tsconfig (as I am "extending" the parent, not "including" it).
The current way means that any configuration that requires relative path will need to be duplicated in all children tsconfig which seems counter intuitive.
Would you know a workaround maybe?
That is a design choice that we made when the feature was first implemented. the rational is files do not really move around, so for path that were originally authored as relative paths, it is strange for these to move around just because the file was used as abase.
The conceptual model to use is that of a class extending a base class, you inherit all the props from the base and you can override them, rather that of a template.
Thanks for your answers :)
I'm having a similar problem, it's there a way that we can use "${cwd}/dist", use an env variable or similar?
This is really annoying. apart from other settings I already need to duplicate, I need to duplicate outDir too in all our packages. If only we could use a JavaScript file as config, so we can use cwd if we want to, and other dynamic configuration.
Most helpful comment
This is really annoying. apart from other settings I already need to duplicate, I need to duplicate
outDirtoo in all our packages. If only we could use a JavaScript file as config, so we can usecwdif we want to, and other dynamic configuration.