Typescript error “Cannot write file … because it would overwrite input file.”

后端 未结 19 1421
醉梦人生
醉梦人生 2021-02-01 12:04

In my Typescript 2.2.1 project in Visual Studio 2015 Update 3, I am getting hundreds of errors in the error list like:

Cannot write file \'C:/{{my-project

19条回答
  •  故里飘歌
    2021-02-01 12:18

    Set outDir.

    "outDir": "./",
    

    this hint is that if you don't set outDir, then the output will be placed directly next to the input file. After allowJs, the JavaScript file will also be compiled. Then, the compiled JavaScript file will overwrite your source file. It’s just reminding you of this.

提交回复
热议问题