Debugging TypeScript files outside wwwroot

后端 未结 5 825
走了就别回头了
走了就别回头了 2020-12-31 09:40

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

5条回答
  •  一向
    一向 (楼主)
    2020-12-31 09:43

    I've stumbled across the same problem. Right now, with Visual Studio 2015 Update 1, and I managed to overcome this issue by placing the tsconfig.json at the project root with the following content (note the exclude):

    {
      "compilerOptions": {
        "module": "amd",
        "noImplicitAny": false,
        "sourceMap": false,
        "target": "es5"
      },
      "exclude": [
        "wwwroot",
        "bower_components",
        "node_modules"
      ]
    }
    

    With this, you can have your task runner to copy *.ts files to the wwwroot and VS will not complain about duplicates. In fact, it will completely ignore all files beneath the paths in the exclude section.

提交回复
热议问题