Tsconfig outDir setting output in root directory

Viewed 17

what do I miss in tsconfig setting? if I just want to output file in the root directory.

if I set

"rootDir":"src" 
"outDir":"build",

or

"rootDir":"src" 
"outDir":"",  -> got what I want, produce jsfile in root directory

both work, but when I set

"rootDir":"src" 
"outDir":"./"

nothing happens, why? can anyone help me?

1 Answers

I believe you must be missing the "baseUrl": "./" setting in the compilerOptions. Without it, the relative path in outDir won't be working.

Related