Skip to content

VS2019 Customise/override Typescript .exe location (using msbuild?). #41355

@Griffork

Description

@Griffork

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:

  • [y] This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • [y] This wouldn't change the runtime behavior of existing JavaScript code
  • [y] This could be implemented without emitting different JS based on the types of the expressions
  • [y] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • [?] This feature would agree with the rest of TypeScript's Design Goals.

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.

Metadata

Metadata

Labels

Visual StudioIntegration with Visual Studio

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions