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. utube视频落地

    utube视频落地 简单粗暴的方法: 利用视频下载网站的网页版进行处理. 比如需要下载的视频的url是vid_url, 需要用到的web服务的url是web_service vid_url='http ...

  2. 【转】WPF中Binding的技巧(一)

    WPF中Binding的技巧(一)   在WPF应用的开发过程中Binding是一个非常重要的部分. 在实际开发过程中Binding的不同种写法达到的效果相同但事实是存在很大区别的. 这里将实际中碰到 ...

  3. COGS 577 蝗灾 [CDQ分治入门题]

    题目链接 昨天mhr神犇,讲分治时的CDQ分治的入门题. 题意: 你又一个w*w正方形的田地. 初始时没有蝗虫. 给你两个操作: 1. 1 x y z: (x,y)这个位置多了z只蝗虫. 2. 2 x ...

  4. hdu 3018

    欧拉回路的题: 主要利用的是并查集,为了节省时间,压缩了它的路径: 代码: #include<cstdio> #include<cstring> #define maxn 10 ...

  5. Cxf + Spring3.0 入门开发WebService

    转自原文地址:http://sunny.blog.51cto.com/182601/625540/ 由于公司业务需求, 需要使用WebService技术对外提供服务,以前没有做过类似的项目,在网上搜寻 ...

  6. 【HDOJ】5288 OO’s Sequence

    二分寻找对于指定pos的最左因数点和最右因数点. /* 5288 */ #include <iostream> #include <string> #include <m ...

  7. IIS中的Application.CommonAppDataPath

    C:\ProgramData\Microsoft Corporation\Internet Information Services\7.5.7600.16385

  8. 避免由于Windows Update自动安装安全补丁导致VM意外重启

     最近我们遇到一些客户报告他们的Windows VM被意外重启导致了其服务中断,我们查看了Event Log发现这个重启的操作时由于Windows update自动安装了安全补丁导致的重启操作.默 ...

  9. java基础(十九)IO流(二)

    这里有我之前上课总结的一些知识点以及代码大部分是老师讲的笔记 个人认为是非常好的,,也是比较经典的内容,真诚的希望这些对于那些想学习的人有所帮助! 由于代码是分模块的上传非常的不便.也比较多,讲的也是 ...

  10. (转载)VC/MFC 工具栏上动态添加组合框等控件的方法

    引言 工具条作为大多数标准的Windows应用程序的 一个重要组成部分,使其成为促进人机界面友好的一个重要工具.通过工具条极大方便了用户对程序的操作,但是在由Microsoft Visual C++开 ...