1

I have a number of projects with identical tsconfig.json files but one is acting strangely.

I have

"outDir": "./lib", 

The results (.js, .d.ts) from src should go into lib directory as in the other projects.

The project is in

y:\dev\HomeControl\NScripts\hcdefs\

and the output is generated in

y:\dev\HomeControl\NScripts\hcdefs\lib\dev\HomeControl\NScripts\hcdefs\src

Why would it use the absolute path rather than the relative path in this one project. Ideas?

1 Answers1

2

You shouldn't write a relative part. Just write it as:

"outDir": "lib", 
Nurbol Alpysbayev
  • 19,522
  • 3
  • 54
  • 89
  • Would it make any difference? To me `lib` is identical to `./lib` – zerkms Dec 06 '18 at 19:31
  • @zerkms In every project I've seen, including VSCode's boilerplate, it's like this, non-relative. And yes, I tried myself, it will definitely make the difference. – Nurbol Alpysbayev Dec 06 '18 at 19:32
  • "make the difference" --- what was your setup and results? Both paths are relative. – zerkms Dec 06 '18 at 19:41
  • 1
    @zerkms If you run yeoman's `yo code` you will see my setup. Than try to change the default setting `out` to `./out` and you will see that your project's parent directory (not the root one!) would be created in 'out' directory. This is weird, but it's how things are. BTW let me know your results, I am curious as well. – Nurbol Alpysbayev Dec 06 '18 at 19:49
  • Tbh I did not try, but this surprises a lot. Nevertheless, +1 :-) – zerkms Dec 06 '18 at 20:41
  • Thanks. I guess so much else uses ./ that 's become idiomatic. I "solved" the problem for this particular case since it was an outlier for my personal use by simply putting the two .ts files in the main directory. I wish I could tell you what was happening but I guess it will have to remain a mystery until it happens again. – BobFrankston Dec 07 '18 at 20:22