2

I've just began with Typescript in Visual Studio. I notice that when I save the TS files, Visual Studio compiles the JS files and they are resided in the same folder as the TS files. But Visual Studio does not reflect those compiled JS files. In other words, Visual Studio did not include those files into the project. The JS files are only visible when I open the folder in Windows Explorer.

And even if I manually include those js files into Visual Studio, they don't appear under the TS files as a subfile of theirs, like they are linked.

How can I get Visual Studio to include the JS files compiled from the TS files automatically?

2
  • Any reason you want them in your project? When you publish, VS should still publish the js files according to some docs, never tried it myself though. Commented Apr 12, 2014 at 18:01
  • 1
    In my experience VS didn't publish the js files unless they were part of the project, which was a bit of a headache. What we really want is to have the js files published but also hidden to avoid trying to edit them while allowing them to be bundled etc.. Commented Jun 13, 2014 at 12:46

2 Answers 2

1

You can use VSCommand plugin http://vscommands.squaredinfinity.com. This plugins adds many useful commands and one of them is the Group items in the Solution Explorer right click menu.

I use that and then WebEssential to minimize the map the result js files.

Sign up to request clarification or add additional context in comments.

1 Comment

awesome. thanks for the tip. Greatly reduces solution ugliness
0

Advances in Visual Studio mean that as of VS2015, generated JS files are deployed despite not being in the project, and dragging the TS file onto a web page in the editor will insert a link tag referencing the generated JS file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.