This lesson shows how to configure the .tsconfig so you only compile the .ts files you want. It then shows how to configure which directory you'd like to compile the files to using "outDir".

tsconfig.json:

{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"noImplicitAny": false,
"sourceMap": false,
"outDir": "./dist"
},
"files": [
"main.ts"
]
}

We added "outDir": Output compiled file to dist folder.

The files we want to compile is main.js.

And main.js will be the main entry file, so for example we have another ts file called two.ts, we can import into main.ts:

import './two';

class Person{

}

Then in the output file, we can see two.js is required into the module using common.js way:

"use strict";
require('./two');
var Person = (function () {
function Person() {
}
return Person;
}());

[TypeScript] Configuring TypeScript Which Files to Compile with "Files" and "OutDir"的更多相关文章

  1. [TypeScript] Configuring a New TypeScript Project

    This lesson walks you through creating your first .tsconfig configuration file which will tell the T ...

  2. Error:Cannot compile Groovy files: no Groovy library is defined for module 'xxxx' 错误处理

    出现 Error:Cannot compile Groovy files: no Groovy library is defined for module 'xxxx' 只要在 project str ...

  3. Learining TypeScript (一) TypeScript 简介

    Learining TypeScript (一) TypeScript 简介 一.TypeScript出现的背景    2 二.TypeScript的架构    2 1.    设计目标    2 2 ...

  4. TypeScript:TypeScript 百科

    ylbtech-TypeScript:TypeScript 百科 TypeScript是一种由微软开发的自由和开源的编程语言.它是JavaScript的一个超集,而且本质上向这个语言添加了可选的静态类 ...

  5. Advanced Installer读取注册表时将Program Files读取为Program Files (x86)的解决办法

    原文:Advanced Installer读取注册表时将Program Files读取为Program Files (x86)的解决办法 今天同事在做安装包的时候,有一个读取注册表路径的需求,需要根据 ...

  6. TypeScript Vs2013 下提示Can not compile modules unless '--module' flag is provided

    VS在开发TypeScript程序时候,如果import了模块有的时候会有如下提示: 这种情况下,只需要对当前TypeScript项目生成设置为AMD规范即可!

  7. [TypeScript] Installing TypeScript and Running the TypeScript Compiler (tsc)

    This lesson shows you how to install TypeScript and run the TypeScript compiler against a .ts file f ...

  8. 6、什么是TypeScript、TypeScript的安装、转换为.js文件

    1.什么是TypeScript (本人用自己的理解梳理了一下,不代表官方意见) TypeScript:Type+ECMAScript6 TypeScript是一种预处理编程语言,遵循es6标准规范,在 ...

  9. 【TypeScript】TypeScript 学习 5——方法

    在 JavaScript 中,有两种方式定义方法. 1.命名的方法 function add(x,y){ return x+y; } 2.匿名方法 var myAdd = function(x,y) ...

随机推荐

  1. sqrt和Hailstone

    求平方根 class SqRoot{ void calcRoot(double z){ double x=1;double y=z/x; while(Math.abs(x-y)>1E-10) { ...

  2. java通过jni方式获取硬盘序列号(windows,linux)

    linux系统java通过jni方式获取硬盘序列号 http://blog.csdn.net/starter110/article/details/8186788 使用jni在windows下读取硬盘 ...

  3. nutch http file 截断问题

    问题: 列表页预计抽取 355+6 但实际只抽取到220条链接. 原因是nutch对http下载的内容的长度进行了限制. 解决方案:这里将这个属性扩大10倍. vim conf/nutch-defal ...

  4. csu 10月 月赛 I 题 The Contest

    Description 殷犇有很多队员.他们都认为自己是最强的,于是,一场比赛开始了~ 于是安叔主办了一场比赛,比赛有n个题目,每个题目都有一个价值Pi和相对能力消耗Wi,但是有些题目因为太坑不能同时 ...

  5. InvalidIndexNameException[Invalid index name [2Shard], must be lowercase]

    [2016-10-11 14:16:42,191][DEBUG][action.admin.indices.create] [Feron] [2Shard] f ailed to create [2S ...

  6. Linux下压缩某个文件夹(文件夹打包)

    tar -zcvf /home/xahot.tar.gz /xahottar -zcvf 打包后生成的文件名全路径 要打包的目录例子:把/xahot文件夹打包后生成一个/home/xahot.tar. ...

  7. POJ_3685_Matrix_(二分,查找第k大的值)

    描述 http://poj.org/problem?id=3685 一个n*n的矩阵,(i,j)的值为i*i+100000*i+j*j-100000*j+i*j,求第m小的值. Matrix Time ...

  8. POJ_2987_Firing_(最大流+最大权闭合图)

    描述 http://poj.org/problem?id=2987 要炒员工鱿鱼,炒了一个人,他的下属一定被炒.给出每个人被炒后公司的收益(负值表示亏损),问怎样炒公司收益最大,以及这种方法炒了几个人 ...

  9. 教程:使用 MongoDB、WCF、OData 和 PowerBI 构建 Azure 上的商业智能解决方案

     发布于 2014-05-20 作者 陈 忠岳 目录 概述 前提条件 创建 Windows Server 2012 Datacenter 虚拟机 通过 WCF(Windows Communicat ...

  10. (转载)最黑的黑客米特尼克:多次耍FBI 终被高手擒

    (转载)http://bbs.chinabyte.com/thread-816847-1-1.html 凯文·米特尼克 50岁 第一个被FBI通缉的黑客,被称为“头号电脑骇客”,曾入侵北美防空指挥系统 ...