Skip to content

Commit 1fd4cb6

Browse files
author
wfc
committed
feat: comments
1 parent 69d92c2 commit 1fd4cb6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

config/rslib-config/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig, LibConfig } from '@rslib/core';
22

33
type LibFormat = LibConfig['format'];
4-
export type BundleType = Boolean | 'excludeExternal';
4+
export type BundleType = boolean | 'excludeExternal';
55

66
interface Options {
77
format?: LibFormat[];
@@ -21,8 +21,13 @@ function getRslibConfig(options: Options) {
2121
};
2222

2323
const libs = format.map(libFormat => {
24-
const lib = getLibShared(libFormat, bundle!);
24+
const lib = getLibShared(libFormat, bundle);
2525
if (libFormat === 'umd') {
26+
if (!umdName) {
27+
throw new Error(
28+
'getRslibConfig: umdName is required when using UMD format',
29+
);
30+
}
2631
lib.umdName = umdName;
2732
lib.bundle = true;
2833
}

packages/coze-js/rslib.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export default defineConfig(
44
getRslibConfig({
55
format: ['esm', 'cjs', 'umd'],
66
bundle: 'excludeExternal',
7-
umdName: 'CozeJs',
87
tsconfigPath: './tsconfig.build.json',
98
}),
109
);

0 commit comments

Comments
 (0)