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

Source: Internet
Author: User
Tags globs

Files globs would be available in TypeScript 2.0, so on the meantime, we need to use "exclude" and "RootDir" to configure W Hich 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 are if you want add all files manually into "Files" config setting, IDEs cannot give the AutoComplete for The rest of the files. From TypeScript 2.0 We'll be able to get the auto complete by just current setting, but is now We need to use "exclude" and "RootDir" to tell TypeScript which files, we want to use.
{    "compileroptions": {        "rootdir": "src",        "module": "Commonjs",        "target": "ES5",        false,        false,        "OutDir" : "./dist",        true    },    "Exclude": [        "Node_modules"     ]}

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.