Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[egg-bin]: ts-node 版本问题 #5064

Closed
zbinlin opened this issue Nov 20, 2022 · 9 comments
Closed

[egg-bin]: ts-node 版本问题 #5064

zbinlin opened this issue Nov 20, 2022 · 9 comments

Comments

@zbinlin
Copy link
Contributor

zbinlin commented Nov 20, 2022

在此输入你需要反馈的 Bug 具体信息(Bug in Detail):

根据文档 编译速度慢 里的说明,egg-bin 里依赖的 ts-node 在新版本不提供文件缓存,锁定在了版本 ~v7 。但是 egg-bin 在后面的更新中把它升级到了 v10,这将导致每次的启动速度(npm run dev)都太慢了。希望能够降级回来。

可复现问题的仓库地址(Reproduction Repo)

NULL

Node 版本号:

v18

Eggjs 版本号:

3.5.0

相关插件名称与版本号(PlugIn and Name):

egg-bin

操作平台与版本号(Platform and Version):

Linux

@fengmk2
Copy link
Member

fengmk2 commented Nov 21, 2022

https://github.com/eggjs/egg-bin/blob/master/package.json#L39
哦,你说是新的有问题?
可以给个复现的代码库例子?

@zbinlin
Copy link
Contributor Author

zbinlin commented Nov 21, 2022

就是 https://github.com/eggjs/egg/blob/master/site/docs/tutorials/typescript.zh-CN.md#%E7%BC%96%E8%AF%91%E9%80%9F%E5%BA%A6%E6%85%A2 这里描述的问题。

仅限于 ts-node@7 ,新的版本由于把文件缓存去掉了,导致特别慢( TypeStrong/ts-node#754 ),因此未升级

简单的示例库体现不出 build 的时间慢的问题,只有当项目代码量大时才有问题。

@fengmk2
Copy link
Member

fengmk2 commented Nov 21, 2022

TS_NODE_TRANSPILE_ONLY=true 也没有生效?

@zbinlin
Copy link
Contributor Author

zbinlin commented Nov 21, 2022

这是可以的,但我不太想跳过类型检测

@fengmk2
Copy link
Member

fengmk2 commented Nov 21, 2022

呃。。。那升级前后没差别啊

@zbinlin
Copy link
Contributor Author

zbinlin commented Nov 21, 2022

你的意思是升级前的版本默认就是不进行类型检测的?

@zbinlin
Copy link
Contributor Author

zbinlin commented Nov 21, 2022

ts-node v8.0.0 去掉了 cache
https://github.com/TypeStrong/ts-node/releases/tag/v8.0.0

@fengmk2
Copy link
Member

fengmk2 commented Jan 1, 2023

我们还是继续使用最新的版本,没法倒退回去。

@fengmk2 fengmk2 closed this as completed Jan 1, 2023
@zbinlin
Copy link
Contributor Author

zbinlin commented Jan 2, 2023

没关系,反正我跑路了 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants