You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/javascript/compile-typescript-code-nuget.md
+20-24Lines changed: 20 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Compile and build TypeScript code using NuGet
3
3
description: Add TypeScript support to your Visual Studio projects by using the NuGet package for portability across different platforms and environments.
4
-
ms.date: 5/15/2025
4
+
ms.date: 4/27/2026
5
5
ms.topic: how-to
6
6
author: "mikejo5000"
7
7
ms.author: "mikejo"
@@ -51,19 +51,25 @@ If Visual Studio is installed, then the node.exe bundled with it will automatica
51
51
Use the following example, which shows a simple *tsconfig.json* file.
52
52
53
53
```json
54
-
{
55
-
"compilerOptions": {
56
-
"noImplicitAny": false,
57
-
"noEmitOnError": true,
58
-
"removeComments": false,
59
-
"sourceMap": true,
60
-
"target": "es5",
61
-
"outDir": "wwwroot/js"
62
-
},
63
-
"include": [
64
-
"scripts/**/*"
65
-
]
66
-
}
54
+
{
55
+
"compileOnSave": true,
56
+
"compilerOptions": {
57
+
"noImplicitAny": false,
58
+
"noEmitOnError": true,
59
+
"removeComments": false,
60
+
"sourceMap": true,
61
+
"target": "ES6",
62
+
"rootDir": "./scripts",
63
+
"outDir": "wwwroot/js"
64
+
},
65
+
"include": [
66
+
"scripts/**/*"
67
+
],
68
+
"exclude": [
69
+
"node_modules",
70
+
"wwwroot"
71
+
]
72
+
}
67
73
```
68
74
69
75
In this example:
@@ -92,16 +98,6 @@ If Visual Studio is installed, then the node.exe bundled with it will automatica
92
98
93
99
Source map files are required for debugging.
94
100
95
-
1. If you want to compile every time you save the project, use the *compileOnSave* option in *tsconfig.json*.
96
-
97
-
```json
98
-
{
99
-
"compileOnSave": true,
100
-
"compilerOptions": {
101
-
}
102
-
}
103
-
```
104
-
105
101
For an example of using gulp with the Task Runner to build your app, see [ASP.NET Core and TypeScript](https://www.typescriptlang.org/docs/handbook/asp-net-core.html).
106
102
107
103
If you run into issues where Visual Studio is using a version of Node.js or a third-party tool that is different than what the version you expected, you may need to set the path for Visual Studio to use. Choose **Tools** > **Options**. Under **Projects and solutions**, choose **Web Package Management** > **External Web Tools**.
0 commit comments