Visual Studio 2013 Typescript compiler isn't respecting '_references.ts' file Visual Studio 2013 Typescript compiler isn't respecting '_references.ts' file typescript typescript

Visual Studio 2013 Typescript compiler isn't respecting '_references.ts' file


Edit: Update: Turns out _references.ts needs to be in the root of your project to be recognized by the compiler. So that's the preferred way :-) This method works too... but please don't do this:


Original workaround:

When reading through my generated RRStore.js file I noticed the order seemed to be in an apparently random order: RR.YoutubeLoader, ProductViewModel, DefenderViewModel, StoreViewModel etc.

I realized there could be only one explanation....

I opened up the .csproj file and sure enough the compiler was processing files in the order they had been initially added to my project!!!.

So I moved the _references.ts file up to the first in the MySite.csproj file - and it is now correctly recognizing it and compiling everything in the right order.

I'm not sure if this is a known bug yet but that was an adequate solution for me.

MyProject.csproj

enter image description here


Sooooo....

Apparently _references.ts needs to be in the root of the project.

I haven't tested this but this is a response from https://typescript.codeplex.com/workitem/2592

I still prefer my way of manually editing the csproj file (so my ts files are all inside Scripts/Typescript). Hopefully sometime they'll change this unintuitive behavior and look for _references.ts wherever it is.


I couldn't find any reference to this in the typescript bug tracker, so I have created one at https://typescript.codeplex.com/workitem/2592