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

在 TypeScript 中引入 JSON 模块 #7927

Merged
merged 3 commits into from
Jan 29, 2021
Merged

在 TypeScript 中引入 JSON 模块 #7927

merged 3 commits into from
Jan 29, 2021

Conversation

PassionPenguin
Copy link
Contributor

译文翻译完成,resolve #7925 @lsvih :)

@ghost
Copy link

ghost commented Jan 27, 2021

@lsvih 校对认领
@PassionPenguin 记得修改下 #7895

@lsvih
Copy link
Member

lsvih commented Jan 27, 2021

@zenblo 好的~

@PassionPenguin
Copy link
Contributor Author

@lsvih 校对认领
@PassionPenguin 记得修改下 #7895

已做修改~🍻

article/2021/importing-json-modules-in-typescript.md Outdated Show resolved Hide resolved
});
```

And there you go! This is how to import JSON modules from within TypeScript modules, only one compiler option away.
这就是在 TypeScript 模块中导入 JSON 模块的方法!我们不过只需要标记一个编译器选项即可。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我们不过只需要标记一个编译器选项即可。
=>我们仅需标记一个编译器选项即可。

@ghost
Copy link

ghost commented Jan 28, 2021

@lsvih 校对完成
@PassionPenguin 文章很棒!

@regon-cao
Copy link
Contributor

@lsvih 校对认领

Copy link
Contributor

@regon-cao regon-cao left a 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} 上监听...`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里代码不用翻译吧

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哎呀这个没啥问题啦(

article/2021/importing-json-modules-in-typescript.md Outdated Show resolved Hide resolved
@@ -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} 上监听...`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用翻译

article/2021/importing-json-modules-in-typescript.md Outdated Show resolved Hide resolved
@PassionPenguin
Copy link
Contributor Author

@regon-cao @zenblo 感谢大大们的校对!🍻

@lsvih

@lsvih lsvih merged commit 475b9f1 into xitu:master Jan 29, 2021
@lsvih
Copy link
Member

lsvih commented Jan 29, 2021

@PassionPenguin 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。

掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件
专栏地址:https://zhuanlan.zhihu.com/juejinfanyi

@PassionPenguin PassionPenguin deleted the translation/importing-json-modules-in-typescript branch January 29, 2021 14:25
regon-cao added a commit to regon-cao/gold-miner that referenced this pull request Jan 30, 2021
在 TypeScript 中引入 JSON 模块 (xitu#7927)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

在 TypeScript 中引入 JSON 模块
3 participants