博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[TypeScript] Configuring TypeScript Which Files to Compile with "Files" and "OutDir"
阅读量:5282 次
发布时间:2019-06-14

本文共 916 字,大约阅读时间需要 3 分钟。

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;}());

 

转载于:https://www.cnblogs.com/Answer1215/p/5571872.html

你可能感兴趣的文章
ZeroBrane Lua脚本编辑器代码自动补全
查看>>
linux下播放mp3
查看>>
POJ1611-The Suspects-并查集
查看>>
笔记--cocos2d-x 3.0 环境搭建
查看>>
2015最新iherb海淘攻略-图文入门教程
查看>>
HTML5 在canvas绘制一个矩形
查看>>
MyEclipse下XFire开发Webservice实例
查看>>
杭电 1421 搬寝室
查看>>
UVA 12075 - Counting Triangles(容斥原理计数)
查看>>
唯品会的一些工作总结
查看>>
vs 2017 community中文版下载地址
查看>>
爬取校园新闻首页的新闻
查看>>
Windows 下 MySql 5.7.20安装及data和my.ini文件的配置(转)
查看>>
shopex模板编辑说明文档
查看>>
Python 黑魔法(持续收录)
查看>>
ZOJ 3891 K-hash
查看>>
一个TensorFlow例子
查看>>
Java 设计模式之单例
查看>>
PAT 1076
查看>>
Mybatis(1) 创建Mybatis HelloWorld
查看>>