microsoft / microsoft/TypeScript

TypeScript for .Net Projects

Open
#63,791 4 comments 3 reactions 1 assignee Claimed by @joj View on GitHub
Possible Improvement
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

## Overview
We heard from people wanting to try TypeScript 7 in their .Net Projects. We're actively working on updating the Microsoft.MSBuild.TypeScript package to support TypeScript 7. In the meantime, I have created a new targets file you can use to get started now.
### How to Use it
1. Place [this targets file](https://github.com/user-attachments/files/24065900/Directory.Build.targets.txt) next to your solution. Rename to Directory.Build.targes or if you already have a Directory.Build.targets file, you can rename to something else and import it directly in your csproj.
2. Install tsgo globally from npm (you can also get it from your own build):
```Shell
npm install -g tsgo
```
3. Configure the TsgoExe property in your project file. The sample uses the default location, but your configuration may be different:
```XML

$(UserProfile)\AppData\Roaming\npm\node_modules\@typescript\native-preview\node_modules\@typescript\native-preview-win32-x64\lib\tsgo.exe

```
4. That's it! TS files will be compiled as part of your build process

### Known Issues
- The TypeScript nuget includes Language Services. This approach will not replace that functionality. If you want to try TypeScript 7 for Language Services in VS, you can go to Tools->Options and find "Enable JavaScript/TypeScript Native Language Service Preview" in Preview Features.
- This targets files only supports building loose .ts files or tsconfig.json based projects. If using tsconfig.json, it must be in the same folder as the project file.
- Cleaning behavior is only supported when using loose .ts files.

### Feedback
Please provide feedback! For feedback on Language Services in VS, use Help->Send Feedback->Report a Problem. For build related feedback, please open an issue on github.com/microsoft/typescript-go.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.