如何处理具有多个 tsconfig.json 文件的项目? [英] How to handle a project with multiple tsconfig.json files?
问题描述
我正在做一个这样结构的项目:
<预><代码>\|- 已建|- 源代码|- 性能|- tsconfig.json|- 打字|- tsconfig.json我的 tsconfig.json
在根目录
"target": "es6","outDir": "已建","rootDir": "./src",
我需要对 perf
文件夹进行不同的配置,就像不同的目标一样.
"target": "es5",
但是,我的 typings
文件夹在我的项目的根目录下,而不是在 perf
文件夹中.所以执行 tsc ./perf
会导致很多错误.
有没有办法告诉 TypeScript 在哪里寻找 typings
?我正在使用
npm install -g typescript@next//打字稿@1.8.0-dev.20151109
或者根据文件夹有不同配置的方法?
有没有办法告诉 TypeScript 在哪里寻找打字
最快的解决方案
将 typings
移到 pref.
长期解决方案
使用 filesGlob
一旦 tsc
支持它:https://github.com/Microsoft/TypeScript/issues/1927
I'm working on a project structured like this:
\
|- built
|- src
|- perf
|- tsconfig.json
|- typings
|- tsconfig.json
My tsconfig.json
on the root
"target": "es6",
"outDir": "built",
"rootDir": "./src",
I need a different configuration on the perf
folder, like a different target.
"target": "es5",
However, my typings
folder is on the root of my project, not inside perf
folder. So doing a tsc ./perf
results in a lot of errors.
Is there a way to tell TypeScript where to look for typings
? I'm using
npm install -g typescript@next
// typescript@1.8.0-dev.20151109
Or a way to have different configurations depending on the folder?
Is there a way to tell TypeScript where to look for typings
Quickest solution
Move typings
into pref.
Long term solution
Use filesGlob
once it is supported in tsc
: https://github.com/Microsoft/TypeScript/issues/1927
这篇关于如何处理具有多个 tsconfig.json 文件的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!