码迷,mamicode.com
首页 > 其他好文 > 详细

[TypeScript] Using Exclude and RootDir until File Globs Lands in 2.0.

时间:2016-06-09 06:24:57      阅读:488      评论:0      收藏:0      [点我收藏+]

标签:

Files globs will be available in TypeScript 2.0, so in the meantime, we need to use "exclude" and "rootDir" to configure which files to load. This lesson shows how to switch from "files" to "exclude".

 

Curently, in tsconfig.json, we use "files" to tell the main entry file as "src/main". And import other file into main.ts. But the problem is if you want add each files manually into "files" config setting, IDEs cannot give the autocomplete for the rest of files.
 
From TypeScript 2.0 We will be able to get the auto complete by just current setting, but for now we need to use "exclude" and "rootDir" to tell TypeScript which files we want to use.
 
{
    "compilerOptions": {
        "rootDir": "src",
        "module": "commonjs",
        "target": "es5",
        "noImplicitAny": false,
        "sourceMap": false,
        "outDir": "./dist",
        "noEmitOnError": true
    },
    "exclude": [
        "node_modules"
    ]
}

 

[TypeScript] Using Exclude and RootDir until File Globs Lands in 2.0.

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/5571893.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!