Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

solution explorer view of typescript and output javascript files

Tags:

typescript

I'm using Visual Studio 2012 with typescript and web essentials 2012 plugin. If you add a new typescript file by right clicking solution explorer > Add New Item > selecting typescript file...eg file1.ts Visual Studio generates the file1.js and file1.min.js as well. In solution explorer, they appear neatly under the file1.ts file root. If you do 'Add Existing item' eg file2.ts, you don't get that neat looking appearance where the generated file2.js appears under the file2.ts name.

Why is that? and what setting do I need to change to make visual studio make all the generated js file appear under the ts file root.

i hope i'm making sense.

btw This has always been the case ever since the first typescript plugin release thanks kashim

like image 926
user2018413 Avatar asked Mar 12 '13 09:03

user2018413


1 Answers

To get the desired effect, you'll need to hack about in the project file. You'll notice that the correctly nested files look like this:

<Content Include="app.js">
  <DependentUpon>app.ts</DependentUpon>
</Content>
<Content Include="app.min.js">
  <DependentUpon>app.ts</DependentUpon>
</Content>

Whereas you probably currently have Content elements for each file without the DependentUpon element inside.

Changing the project file to match this example will nest the items for you.

like image 59
Fenton Avatar answered Nov 15 '22 11:11

Fenton