Skip to content

Commit 8efe84b

Browse files
committed
up
1 parent a0f20a0 commit 8efe84b

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

packages/core/src/config.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import type {
4040
PkgJson,
4141
Redirect,
4242
RsbuildConfigOutputTarget,
43+
RsbuildConfigWithLibInfo,
4344
RslibConfig,
4445
RslibConfigAsyncFn,
4546
RslibConfigExport,
@@ -1180,12 +1181,6 @@ async function composeLibRsbuildConfig(config: LibConfig, configPath: string) {
11801181
);
11811182
}
11821183

1183-
type RsbuildConfigWithLibInfo = {
1184-
id?: string;
1185-
format: Format;
1186-
config: RsbuildConfig;
1187-
};
1188-
11891184
export async function composeCreateRsbuildConfig(
11901185
rslibConfig: RslibConfig,
11911186
path?: string,

packages/core/src/types/config/index.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ export type FixedEcmaVersions =
1818
export type LatestEcmaVersions = 'es2024' | 'esnext';
1919
export type EcmaScriptVersion = FixedEcmaVersions | LatestEcmaVersions;
2020

21+
export type RsbuildConfigWithLibInfo = {
22+
id?: string;
23+
format: Format;
24+
config: RsbuildConfig;
25+
};
26+
2127
export type RsbuildConfigOutputTarget = NonNullable<
2228
RsbuildConfig['output']
2329
>['target'];
@@ -73,12 +79,7 @@ export type Redirect = {
7379

7480
export interface LibConfig extends RsbuildConfig {
7581
/**
76-
* Each lib configuration has a unique identifier used to distinguish different lib configurations.
77-
* By default, Rslib generates a unique identifier based on the order of lib configurations, in the format `${format}${index}`.
78-
* When there is only one lib of the format, the index is empty, otherwise, it starts from 0 and increments.
79-
* For example:
80-
* - If only ESM and CJS formats are configured, the identifier for ESM is `esm` and for CJS is `cjs`.
81-
* - If two ESM formats and one CJS format are configured, they are represented as `esm0`, `esm1`, and `cjs`.
82+
* The unique identifier of the library.
8283
* @default undefined
8384
*/
8485
id?: string;

0 commit comments

Comments
 (0)