Skip to content

Commit 02bb3e2

Browse files
committed
docs: format
1 parent f28f1d5 commit 02bb3e2

File tree

5 files changed

+21
-56
lines changed

5 files changed

+21
-56
lines changed

website/docs/en/config/lib/bundle.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
Specify whether to bundle the library, which is known as bundle mode when `bundle` is set to `true`, and bundleless mode when set to `false`.
77

8+
See [bundle / bundleless](/guide/basic/output-structure#bundle--bundleless) for more details.
9+
810
::: warning
911

1012
The bundleless mode is not fully supported yet, and some features like assets may not work properly.
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
# lib.format
22

3-
- **Type:** `string`
3+
- **Type:** `'esm' | 'cjs' | 'umd' | 'mf'`
4+
45
- **Default:** `undefined`
6+
7+
- **Required**: true
8+
9+
Specify the output format of the library.
10+
11+
See [Output Format](/guide/basic/output-format) and [Module Federation](/guide/advanced/module-federation) for more details.
12+
13+
::: note
14+
15+
The `umd` format only works when [bundle](/config/lib/bundle) is set to `true`.
16+
17+
:::

website/docs/en/guide/basic/_meta.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
"typescript",
55
"output-format",
66
"output-structure",
7-
"upgrade-rslib",
8-
"umd"
7+
"upgrade-rslib"
98
]

website/docs/en/guide/basic/output-format.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,16 @@ A detailed answer from StackOverflow: [What is the Universal Module Definition (
8383
8484
### How to build a UMD library?
8585

86-
- Set the `output.format` to `umd` in the Rslib configuration file.
87-
- If the library need to be exported with a name, set `output.umdName` to the name of the UMD library.
86+
- Set the `lib.format` to `umd` in the Rslib configuration file.
87+
- If the library need to be exported with a name, set `lib.umdName` to the name of the UMD library.
8888
- Use `output.externals` to specify the external dependencies that the UMD library depends on, `lib.autoExtension` is enabled by default for UMD.
8989

9090
### Examples
9191

9292
The following Rslib config is an example to build a UMD library.
9393

94-
- `output.format: 'umd'`: instruct Rslib to build in UMD format.
95-
- `output.umdName: 'RslibUmdExample'`: set the export name of the UMD library.
94+
- `lib.format: 'umd'`: instruct Rslib to build in UMD format.
95+
- `lib.umdName: 'RslibUmdExample'`: set the export name of the UMD library.
9696
- `output.externals.react: 'React'`: specify the external dependency `react` could be accessed by `window.React`.
9797
- `runtime: 'classic'`: use the classic runtime of React to support applications that using React version under 18.
9898

website/docs/en/guide/basic/umd.mdx

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)