Skip to content

Commit 972876d

Browse files
committed
chore: update
1 parent b244a96 commit 972876d

File tree

6 files changed

+52
-53
lines changed

6 files changed

+52
-53
lines changed

website/docs/zh/guide/advanced/dts.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ import { PackageManagerTabs } from '@theme';
6262

6363
你可以参考 [lib.dts](/config/lib/dts) 获取更多有关 DTS 配置的详细信息。
6464

65-
:::
65+
:::

website/docs/zh/guide/advanced/module-federation.mdx

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export default defineConfig({
151151

152152
Rslib 支持使用 Storybook 开发 Module Federation Rslib 项目。
153153

154-
#### 1. 启动库的 MF `dev`
154+
#### 1. 启动库的 MF `dev`
155155

156156
添加 `dev` 命令在 `package.json` 文件:
157157

@@ -179,52 +179,52 @@ Rslib 支持使用 Storybook 开发 Module Federation Rslib 项目。
179179

180180
<PackageManagerTabs command="add storybook-addon-rslib @module-federation/storybook-addon -D" />
181181

182-
2. 然后创建 Storybook 配置文件 `.storybook/main.ts`,指定 stories 和 addons,并设置 framework 和相应的 framework 集成。
182+
2. 然后创建 Storybook 配置文件 `.storybook/main.ts`,指定 stories 和 addons,并设置 framework 和相应的 framework 集成。
183183

184184
```ts title=".storybook/main.ts" {18-38}
185-
import { dirname, join } from 'node:path';
186-
import type { StorybookConfig } from 'storybook-react-rsbuild';
187-
188-
function getAbsolutePath(value: string): any {
189-
return dirname(require.resolve(join(value, 'package.json')));
190-
}
191-
192-
const config: StorybookConfig = {
193-
stories: [
194-
'../stories/**/*.mdx',
195-
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
196-
],
197-
framework: {
198-
name: getAbsolutePath('storybook-react-rsbuild'),
199-
options: {},
200-
},
201-
addons: [
202-
{
203-
name: getAbsolutePath('storybook-addon-rslib'),
204-
options: {
205-
rslib: {
206-
include: ['**/stories/**'],
207-
},
208-
},
209-
},
210-
{
211-
name: '@module-federation/storybook-addon/preset',
212-
options: {
213-
// 在添加 rslib module manifest 给 storybook dev
214-
// 我们在上面已经设置了 dev.assetPrefix 和 server.port 到 3001 在 rslib.config.ts
215-
remotes: {
216-
'rslib-module':
217-
//还可以在这里添加 storybook 的 shared
218-
// shared: {}
219-
'rslib-module@http://localhost:3001/mf/mf-manifest.json',
220-
},
221-
},
222-
},
223-
],
224-
};
225-
226-
export default config;
227-
```
185+
import { dirname, join } from 'node:path';
186+
import type { StorybookConfig } from 'storybook-react-rsbuild';
187+
188+
function getAbsolutePath(value: string): any {
189+
return dirname(require.resolve(join(value, 'package.json')));
190+
}
191+
192+
const config: StorybookConfig = {
193+
stories: [
194+
'../stories/**/*.mdx',
195+
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
196+
],
197+
framework: {
198+
name: getAbsolutePath('storybook-react-rsbuild'),
199+
options: {},
200+
},
201+
addons: [
202+
{
203+
name: getAbsolutePath('storybook-addon-rslib'),
204+
options: {
205+
rslib: {
206+
include: ['**/stories/**'],
207+
},
208+
},
209+
},
210+
{
211+
name: '@module-federation/storybook-addon/preset',
212+
options: {
213+
// 在添加 rslib module manifest 给 storybook dev
214+
// 我们在上面已经设置了 dev.assetPrefix 和 server.port 到 3001 在 rslib.config.ts
215+
remotes: {
216+
'rslib-module':
217+
//还可以在这里添加 storybook 的 shared
218+
// shared: {}
219+
'rslib-module@http://localhost:3001/mf/mf-manifest.json',
220+
},
221+
},
222+
},
223+
],
224+
};
225+
226+
export default config;
227+
```
228228

229229
#### 3. 用远程模块 编写 stories
230230

website/docs/zh/guide/solution/nodejs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default defineConfig({
5050
});
5151
```
5252

53-
## Node.js 中的 target
53+
## Node.js 中的 target
5454

5555
Rslib 默认将 [target](/config/rsbuild/output#outputtarget) 设置为 `"node"`,这与 Rsbuild 的target 默认值不同。
5656

@@ -68,4 +68,4 @@ Rslib 默认将 [target](/config/rsbuild/output#outputtarget) 设置为 `"node"`
6868

6969
{/* TODO: Rspack doesn't support createRequire now */}
7070
{/* ### createRequire */}
71-
{/* Requiring module with [createRequire](https://nodejs.org/api/module.html#modulecreaterequirefilename) will also works in ESM format. */}
71+
{/* Requiring module with [createRequire](https://nodejs.org/api/module.html#modulecreaterequirefilename) will also works in ESM format. */}

website/docs/zh/guide/solution/react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ export default defineConfig({
110110
## 进一步了解
111111

112112
- [Rsbuild React Plugin](https://rsbuild.dev/plugins/list/plugin-react#swcreactoptionsruntime)
113-
- [SWC Compilation - jsc.transform.react](https://swc.rs/docs/configuration/compilation#jsctransformreact)
113+
- [SWC Compilation - jsc.transform.react](https://swc.rs/docs/configuration/compilation#jsctransformreact)

website/docs/zh/guide/start/glossary.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CJS 代表 [CommonJS](https://nodejs.org/api/modules.html#modules-commonjs-modul
1515

1616
## UMD
1717

18-
<UMD/>
18+
<UMD />
1919

2020
## 无捆绑
2121

@@ -27,8 +27,8 @@ DTS代表[TypeScript声明文件](https://www.typescriptlang.org/docs/handbook/d
2727

2828
## 模块联盟
2929

30-
<MF/>
30+
<MF />
3131

3232
## 更多
3333

34-
请参阅 [Rsbuild-术语表](https://rsbuild.dev/guide/start/glossary)[Rspack-术语表](https://rspack.dev/misc/glossary) 中的更多术语。
34+
请参阅 [Rsbuild-术语表](https://rsbuild.dev/guide/start/glossary)[Rspack-术语表](https://rspack.dev/misc/glossary) 中的更多术语。

website/docs/zh/guide/start/quick-start.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,3 @@ Options:
131131

132132
- [从 tsup 迁移](/guide/migration/tsup)
133133
- [从 Modern.js Module 迁移](/guide/migration/modernjs-module)
134-

0 commit comments

Comments
 (0)