tsconfig.json not used by TypeScript compiler?

白昼怎懂夜的黑 提交于 2019-12-06 14:18:14

Running tsc src\file2.ts will only use src\file2.ts as the input.

Run tsc in the directory with no input files for it to use the tsconfig.json, and input all .ts files in the directory and subdirectories.

As for why tsc src\file2.ts doesn't work. Your reference was missing a slash.

// <reference path='file1.ts' />

should be:

/// <reference path='file1.ts' />

I'm not sure if this will be relevant to your work but your zip contains an empty tsconfig.json. I filled it in with some options and actually was able to compile, both from the command line and from the editor.

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "rootDir": ".",
        "outDir": ".",
        "sourceMap": false
    },
    "filesGlob": [
        "./src/*.ts"
    ]
}

I hope this leads you somewhere.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!