Closed
Description
I have a source structure in which there is a single top-level directory, and I expect the same structure to be produced in the outDir, instead it is dropped. It seems that tsc trims singleton parent directories.
That behavior is okay, but I would like to be able to explicitly say what the baseDir is, and have the output structure match the input, relative to the baseDir.
Here is a session which demonstrates the problem:
alexeagle-macbookpro2:tmp alexeagle$ mkdir -p dir1/dir2/dir3
alexeagle-macbookpro2:tmp alexeagle$ cat > dir1/dir2/dir3/test3.ts
console.log("dir3");
alexeagle-macbookpro2:tmp alexeagle$ mkdir out
alexeagle-macbookpro2:tmp alexeagle$ tsc --outDir out dir1/dir2/dir3/test3.ts
alexeagle-macbookpro2:tmp alexeagle$ ls out/
test3.js
alexeagle-macbookpro2:tmp alexeagle$ cat > dir1/dir2/test2.ts
console.log('dir2');
alexeagle-macbookpro2:tmp alexeagle$ tsc --outDir out dir1/dir2/dir3/test3.ts dir1/dir2/test2.ts
alexeagle-macbookpro2:tmp alexeagle$ ls out
dir3 test2.js
It's kind of surprising that by adding a file in dir2, the test3.js file has disappeared from the outDir.