-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VS2019 Customise/override Typescript .exe location (using msbuild?). #41355
Comments
I think there are a couple of points of confusion to clear up here.
From the VS developer command prompt:
I'm going to re-emphasize that this setting is unsupported and its behavior may change in future versions of VS - but then so is using a custom tsc wrapper 🙂 |
Thanks for the quick reply, that was a lot faster than I was expecting. I do in fact have a custom tsserver..js! (I'm using ttypescript which generates both) It's not clear from the key itself, but I'm guessing that changing that value changes the tsserver used for all projects? Edit: To clarify I work on the two solutions separately. I'd want the custom tsserver to be used for all projects in a single visual studio instance, and a normal tsserver for another instance. I do not want them running side-by-side I just don't want to have to continually edit the registry to switch between them. If the registry edit just adds another entry to the project's TypeScript version drop-down (in project settings) that would be the most perfect. |
@minestarks any chance on getting some clarification on this? |
I would just try it, but I'm pretty sure you should be able to lock yourself to a specific TS version at a project-level granularity. https://github.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017 |
@DanielRosenwasser the question was does using the custom registry key override all typescript versions, just one of them or create a new entry? Your link seems to be about changing typescript versions in general (with different SDKs) which is exactly what I was talking about in the last sentance of my last post. I'm already aware that drop-down exists I just wanted to confirm that the registry key would work with that drop-down rather than clobber it. I don't like editing my registry on a whim, so I'd prefer to know in advance whether or not I can use it, particularly since I use this machine for work on a project that doesn't have an altered compiler, so it's pretty important that I know that that's not going to break. |
The reg key should be removable if it doesn't work but I won't pressure you into changing it if you're not comfortable with that. I'm not sure, @PranavSenthilnathan or @minestarks may be able to answer this. |
Setting the key clobbers. I think you can also set the Since you have your own custom tsserver though, you should be able to create your own "SDK version". Below is what I just tried and I would normally not recommend doing this, but since you have a custom tsserver I don't think I can stop you:
I would really like to add a menu to VS that just lets you restart the server, select version, etc... |
Ooooh! Thank you @jessetrinity for the answer and the workarounds. I'd love to see a menu like that too, but making a custom SDK works too. Could I name it 0.1 since 0.8 was the first public build, so it shouldn't be able to ever conflict? |
Microsoft.NodejsTools.targets, Microsoft.NodejsToolsV2.targets, msbuild, VS2019, Ttypescript, Typescript, node_modules.
Suggestion
So I just switched over to using Visual Studio 2019 (from 2017) and found that creating a new Typescript web project uses Microsoft.NodejsToolsV2.targets instead of Microsoft.NodejsTools.targets which requires using a Typescript install in node_modules instead of the built-in SDK. This got me excited because I thought I'd be able to overwrite a variable to point to the custom wrapper for tsc that I'm using (ttypescript), but unfortunately not the case.
Currently it is possible to switch the build & clean version of tsc over to a custom location by creating your own .targets file and c# script to run tsc with the provided configuration and providing all the settings as appropriate (as I have done), however the tsc used by CompileOnSave is hardcoded into the SDK, and cannot be changed using msbuild. So I've lost all compile on save support (if I turn CompileOnSave on my output is overwritten by javascript that doesn't run).
So I'm requesting the ability to specify explicitly where tsc is located, so that I can use a custom wrapper instead of the default tsc in VS2019. I'm perfectly fine for this to be only available within msbuild or the project properties.
Use Cases
This will allow me to use the experimental typescript transforms prior to the official implementation within vs 2019 across my projects while still being able to use compile-on-save.
Examples
I don't know what to put here aside from what I've already said.
Checklist
My suggestion meets these guidelines:
Final note:
Whenever I raise these issues people tell me to switch to VS code. Please don't. I'm too dependant on the VS->Azure workflow to make the switch.
The text was updated successfully, but these errors were encountered: