reference elements still required?

Topics: General
Dec 12, 2013 at 8:24 PM
I accidentally deleted the reference paths at the top of my (VS 2013) file and TS 0.9.5 still found everything. Is TS now automatically referencing all the ts files in my project? in my directory? Under what if any circumstances should or must I include a reference path in my ts file?
Developer
Dec 12, 2013 at 9:31 PM
Yes, Visual Studio now implicitly references files within a project. See http://blogs.msdn.com/b/typescript/archive/2013/12/05/announcing-typescript-0-9-5.aspx

Using _references.ts

With the previous improvements to the Visual Studio experience, we've moved to projects implicitly referencing the .ts files contained in the project. This cut down on having to explicitly reference your files in the project, bringing the experience much closer to C#. Unfortunately, it also did not work well when using the option to concatenate your output .js file.

We're continuing to improve this experience. Starting with 0.9.5, you can now add an _references.ts file to your project. This file will be the first passed to the compiler, allowing you more control over the order the generated .js file when used in combination with the Combine JavaScript output into file option (the equivalent of using the --out commandline option).
Dec 14, 2013 at 6:56 PM
Thanks. Still having a little trouble. Can you tell me what exactly they mean by "contained in the project". Is that the folder? or is it using the csproj file? I've got a TS file in a subfolder and tsc is not finding my referenced types defined in a parent folder.
Dec 15, 2013 at 7:01 PM
@GaryB611, In the phrase "contained in the project" project refers to the Visual Studio project - not the folder.

Do you have Build Action set to "TypeScriptCompile" for the files in the parent folder?
Mar 11, 2014 at 3:15 PM
I'm not finding this to be true for a couple of my files. I can't get some of my files to compile unless I make sure the references are included.