美文网首页我爱编程
使用gulp实现typescript得自动化编译

使用gulp实现typescript得自动化编译

作者: 秋末寒雨 | 来源:发表于2017-02-16 17:15 被阅读0次

先看下目录结构:

1.首先下载相应得包:

npm install gulp gulp-typescript typescript --save

npm install gulp -g

2.配置tsconfig.json

参数解析:

module:编译模块得标准

target:目标js标准

allowJs:是否接收js文件作为来源

sourceMap:是否使用map

outDir:输出路径文件夹

noImplicitReturns:函数末尾返回值

allowUnreachableCode:是否允许文件中存在执行不到得代码

exclude:要排除得目录

include:包含得目录

3.配置gulpfile.js

此时运行gulp命令后,就可以实现ts文件夹中得ts文件编译到js文件夹下得效果,并且实现监听。

相关文章

网友评论

    本文标题:使用gulp实现typescript得自动化编译

    本文链接:https://www.haomeiwen.com/subject/mzshwttx.html