-
Notifications
You must be signed in to change notification settings - Fork 5k
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
在 TypeScript 中引入 JSON 模块 #7927
在 TypeScript 中引入 JSON 模块 #7927
Conversation
@lsvih 校对认领 |
@zenblo 好的~ |
已做修改~🍻 |
}); | ||
``` | ||
|
||
And there you go! This is how to import JSON modules from within TypeScript modules, only one compiler option away. | ||
这就是在 TypeScript 模块中导入 JSON 模块的方法!我们不过只需要标记一个编译器选项即可。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们不过只需要标记一个编译器选项即可。
=>我们仅需标记一个编译器选项即可。
@lsvih 校对完成 |
@lsvih 校对认领 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
import * as express from "express"; | ||
import * as config from "./config.json"; | ||
|
||
const app = express(); | ||
|
||
app.listen(config.server.nodePort, () => { | ||
console.log(`Listening on port ${config.server.nodePort} ...`); | ||
console.log(`在端口 ${config.server.nodePort} 上监听...`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里代码不用翻译吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哎呀这个没啥问题啦(
@@ -38,35 +38,35 @@ const config = require("./config.json"); | |||
const app = express(); | |||
|
|||
app.listen(config.server.nodePort, () => { | |||
console.log(`Listening on port ${config.server.nodePort} ...`); | |||
console.log(`在端口 ${config.server.nodePort} 上监听...`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不用翻译
Co-authored-by: zenblo <[email protected]>
Co-authored-by: regonCao <[email protected]>
@regon-cao @zenblo 感谢大大们的校对!🍻 |
@PassionPenguin 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。 掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件。 |
在 TypeScript 中引入 JSON 模块 (xitu#7927)
译文翻译完成,resolve #7925 @lsvih :)