tsc(TypeScript编译器)和ts-node有什么区别? [英] What's the difference between tsc (TypeScript compiler) and ts-node?

查看:2567
本文介绍了tsc(TypeScript编译器)和ts-node有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对tscts-node之间的区别感到非常困惑.我正在学习TypeScript,通常使用tsc命令来转换服务器.ts文件.

I'm very confused about the difference between tsc and ts-node. I'm learning TypeScript and I usually transpile server .ts files with tsc command.

现在,我正在使用 nestjs 框架,我发现它使用的是ts-node.

Now, I'm approaching nestjs framework, and I see that it uses ts-node.

那么两者之间有什么区别?我应该使用哪一个?

So what's the difference between the two? Which one should I use?

推荐答案

主要区别是tsc根据您的tsconfig转换所有文件. 取而代之的是,ts-node将从入口文件开始,然后根据导入/导出在树中逐步移植文件

The main difference is that tsc transpile all the file according to your tsconfig. Instead, ts-node will start from the entry file and transpile the file step by step through the tree based on the import/export

这篇关于tsc(TypeScript编译器)和ts-node有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆