Skip to content

Commit 2dabf0e

Browse files
committed
chore: update
1 parent 2a068d8 commit 2dabf0e

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

packages/core/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ const composeEntryConfig = async (
909909
throw new Error(
910910
`The ${color.cyan('source.entry')} configuration should be an object, but received ${typeof entries}: ${color.cyan(
911911
entries,
912-
)}. Please check your configuration and ensure it is correctly configured.`,
912+
)}. Checkout ${color.green('https://lib.rsbuild.dev/config/rsbuild/source#sourceentry')} for more details.`,
913913
);
914914
}
915915

tests/integration/entry/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,6 @@ test('validate entry and throw errors', async () => {
165165
}
166166

167167
expect(stripAnsi(errMsg)).toMatchInlineSnapshot(
168-
`"The source.entry configuration should be an object, but received string: ./src/**. Please check your configuration and ensure it is correctly configured."`,
168+
`"The source.entry configuration should be an object, but received string: ./src/**. Checkout https://lib.rsbuild.dev/config/rsbuild/source#sourceentry for more details."`,
169169
);
170170
});

website/docs/en/config/rsbuild/source.mdx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,23 @@ Used to set the entry modules for building.
2525

2626
In Rslib, the default value is:
2727

28-
- bundle mode: `src/index.(ts|js|tsx|jsx|mjs|cjs)`
28+
- bundle mode:
29+
30+
```ts
31+
const defaultEntry = {
32+
// default support for other suffixes such as ts, tsx, jsx, mjs, cjs
33+
index: 'src/index.js',
34+
};
35+
```
36+
2937
- bundleless mode: `src/**`
3038

39+
```ts
40+
const defaultEntry = {
41+
index: 'src/**',
42+
};
43+
```
44+
3145
:::info
3246
Check out the [lib.bundle](/config/lib/bundle#set-entry) to learn more about how to set entry for bundle and bundleless project.
3347
:::

website/docs/zh/config/rsbuild/source.mdx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,22 @@ import { RsbuildDocBadge } from '@components/RsbuildDocBadge';
2424

2525
在 Rslib 中,默认值为:
2626

27-
- bundle 模式:`src/index.(ts|js|tsx|jsx|mjs|cjs)`
28-
- bundleless 模式:`src/**`
27+
- bundle 模式:
28+
29+
```ts
30+
const defaultEntry = {
31+
// default support for other suffixes such as ts, tsx, jsx, mjs, cjs
32+
index: 'src/index.js',
33+
};
34+
```
35+
36+
- bundleless 模式:
37+
38+
```ts
39+
const defaultEntry = {
40+
index: 'src/**',
41+
};
42+
```
2943

3044
:::info
3145
参考 [lib.bundle](/config/lib/bundle#set-entry) 进一步了解如何为 bundle 和 bundleless 项目设置入口。

0 commit comments

Comments
 (0)