grunt-ts
grunt-ts copied to clipboard
Support rootDir tsc option, omit .baseDir.ts when specified
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.
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?
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.
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.