【问题标题】:Typescript: tsconfig.json outDir property does not work打字稿:tsconfig.json outDir 属性不起作用
【发布时间】:2016-05-25 20:44:59
【问题描述】:

我有以下tsconfig.json,我想在build/ 文件夹中获得转译输出

{
    "compileOptions": {
        "module": "amd",
        "noImplicitAny": "true",
        "removeComments": "true",
        "target": "es5",
        "sourceMaps": true,
        "outDir": "build/"
    },
}

但是它不起作用。我让它工作的唯一方法是将outDir 作为标志传递给tsc

我找到了一个question,它询问了我遇到的相同问题。但是我使用的是打字稿版本 1.8.10。我已经在那里尝试了建议的解决方案,但仍然无法正常工作。

任何人都知道我如何让tsc 读取outDirtsconfig.json 文件中设置的属性?

【问题讨论】:

    标签: typescript tsconfig


    【解决方案1】:

    选项名称是compilerOptions 而不是compileOptions

    {
        "compilerOptions": {
            "module": "amd",
            "noImplicitAny": "true",
            "removeComments": "true",
            "target": "es5",
            "sourceMaps": true,
            "outDir": "build/"
        },
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-21
      • 1970-01-01
      • 2021-09-04
      • 2020-09-02
      • 2020-03-18
      • 1970-01-01
      • 2017-02-20
      • 1970-01-01
      相关资源
      最近更新 更多