0
votes

I have the following Visual Studio 2017 ASPX.NET Web App:

File1: App.html

<html>
<head><script src="App.js"></script></head>
<body>Hello World</body>
</html>

File 2: App.ts

namespace OurLibs {
    export class Test {
        public run() {
            alert("Hello World");
        }
    }
    new Test().run();
}

I have set the properties on the App.ts file to be "Copy If Newer". When I publish this application using Web Deploy it publishes all the files and the project runs as expected. But when I attempt to debug the source within a browser the ts file cannot be found because it was published to the /bin folder and the .map file is not specifying the path just the file name. Within the project all files are in the same source folder.

Does anyone know how to get this simple project to publish with valid references to the ts files in the .map ?

1

1 Answers

0
votes

Amazingly I finally stumbled across the answer. By using an external tsconfig.json you can change the Build Action for the ts file from TypeScriptCompile to Content. This causes the ts file to be published to the location it is rather than the bin folder thus causing the .map reference to be correct. Thus everything works!