How should I debug TypeScript files in ASP.NET 5?
Suppose solution layout as on the following picture. Notice .ts Scripts are outside wwwroot folder and compiled .js file is getting there via Grunt task.
The task also creates .map file which references the original .ts files.
Note however that reference goes outside wwwroot (../Scripts/app.ts). This obviously doesn't work in a browser.
I added the following action to one of my controllers, where
appEnvironment is an
IApplicationEnvironment injected into your controller:
Conveniently, the new web servers strip out the ../ (I'm assuming for security purposes), so you don't even have to worry about having them in the Route. (Note that you need to not have a
[RoutePrefix] attribute on the controller itself for these paths to work.)