grunt-ts icon indicating copy to clipboard operation
grunt-ts copied to clipboard

Support rootDir tsc option, omit .baseDir.ts when specified

Open JeroMiya opened this issue 10 years ago • 3 comments
trafficstars

Typescript 1.5 supports a --rootDir option, which addresses the issue this grunt-ts option was intended to solve: https://github.com/TypeStrong/grunt-ts/issues/77

Support the rootDir option, and, when specified, do not generate the .baseDir.ts file at the root directory - it is no longer needed.

JeroMiya avatar Jul 24 '15 15:07 JeroMiya

Thanks for this feedback. I will consider it. The trouble is that we intend to support down-level compilers (or even custom ones) in addition to the latest and honestly we haven't developed a foolproof way to tell which version of the compiler we're using without reading package.json (which could be lying).

Do you have a suggestion?

nycdotnet avatar Jul 24 '15 21:07 nycdotnet

My suggestion would be to document that the option requires typescript 1.5, or a compiler that takes the rootDir option, and warn that it won't work otherwise. Basically, treat it like any other new compiler option that is added to the compiler in a particular version.

Does tsc have a --version argument? If so you might also be able to just run that once and parse the version. Not sure.

JeroMiya avatar Jul 24 '15 21:07 JeroMiya

I looked into this further and I retract my earlier statement. There shouldn't be a backward-compatibility concern. I was thinking we had an existing rootDir option, but my memory of it was incorrect.

I agree that we should be able to implement this, and hopefully if rootDir is passed we can skip the .baseDir.ts file emit.

nycdotnet avatar Jul 24 '15 22:07 nycdotnet