Difference between revisions of "Typescript"
(→Add to ASP.NET project)
|Line 21:||Line 21:|
Revision as of 16:35, 6 November 2021
Full Title or Meme
Add to ASP.NET project
- Add>New Item>TypeScript JSON Configuration File (Do Not change its name)
- in tsconfig.json change target library to a current version, like "target": "es2015"
- and add this line "outDir": "wwwroot/js" which will force the output from the ts compilation to that dir
- Add>New Item> TypeScript File (Any name will work, say add.ts, we assume you are starting with no existing JS, so we call it site.js)
- Since we used an existing file, this line is already in the _Layout.cshtml <script src="~/js/site.js" asp-append-version="true"></script>
- Create an ASP.NET Core app with TypeScript in Visual Studio 2021-10-06