Skip to content

Commit 0bce8c8

Browse files
SoonIterTimeless0911
authored andcommitted
docs: complete en json files
1 parent 49f2198 commit 0bce8c8

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

website/docs/en/guide/advanced/json-files.mdx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# 引用 JSON 文件
1+
# Import JSON files
22

3-
Rslib 支持在代码中引用 JSON 文件。
3+
Rslib supports import JSON files in code.
44

5-
## JSON 文件
5+
## JSON file
66

7-
你可以直接在 JavaScript 文件中引用 JSON 文件。
7+
You can directly reference JSON files in JavaScript files.
88

9-
### 默认引用
9+
### Default Import
1010

1111
```json title="example.json"
1212
{
@@ -24,17 +24,16 @@ console.log(example.items); // [1, 2];
2424

2525
:::warning
2626

27-
在 Bundle 模式下,JSON 文件支持默认引用和具名引用。
28-
29-
在 Bundleless 模式下,JSON 文件仅支持具名引用。
27+
In Bundle mode, JSON files support both default and named imports.
28+
In Bundleless mode, JSON files only support named imports.
3029

3130
:::
3231

33-
### 具名引用
32+
### Named Import
3433

35-
Rslib 同样支持通过 named import 来引用 JSON 文件:
34+
Rslib also supports referencing JSON files through named imports:
3635

37-
下面是一个使用示例,假设源码如下:
36+
Here is an example, assuming the source code is as follows:
3837

3938
import { Tabs, Tab } from '@theme';
4039

@@ -60,7 +59,7 @@ console.log(name); // 'foo';
6059
</Tab>
6160
</Tabs>
6261

63-
会根据配置文件中的 [产物结构](/guide/basic/output-structure) 配置,打包出如下产物:
62+
Based on the configuration in the [output structure](/guide/basic/output-structure) specified in the configuration file, the following outputs will be packaged:
6463

6564
<Tabs>
6665
<Tab label="Bundle">

0 commit comments

Comments
 (0)