1

I'm using VS 2013 Community Edition Update 4 with Web Essentials, and when I add a new typescript file and save it, the .js file is generated.

But then when I try to add it to the index VS doesn't sense the .js to autocomplete the href attribut in the <script> tag.

If I add it by hand it works, the app works, the .js was generated but it doesn't seem to be part of the project, but it's a bit annoying to me.

Does anyone have a solution or something I'm missing ?

1
  • The JavaScript files are a build artefact, like DLLs - so they aren't included in the project. Commented Apr 8, 2015 at 7:15

2 Answers 2

2

In the solution explorer click the

enter image description here

icon, then right click on the .js file on the project tree and press include in project. Once the file is part of your project VS will autosuggest this file for href references.

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

3 Comments

Thank you, I'll try this and then mark it as an accepted answer, do you by any chance know of a setting which means I wouldn't need to do this by hand with every script ?
@GeorgeBora VS does not automatically include all the files that exists under the project directory of your project, so you will have to manually include the files that are not added to the project directly.
This will work and allow your project to "see" your js files, but I would advise against this, because essentially you're including compiled code in your project (see more info in my answer here: stackoverflow.com/questions/29495592/…)
1

With VS2015 you merely drag the TS file onto the editor. You will find that a JS tag is inserted in your code. This does not work in VS2013.


I have removed the method for rewriting URLs because it interferes with use of source mapping to directly debug typescript in VS and in the browser.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.