Skip to content

Commit

Permalink
feat: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wfc committed Dec 3, 2024
1 parent 69d92c2 commit 1fd4cb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 7 additions & 2 deletions config/rslib-config/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig, LibConfig } from '@rslib/core';

type LibFormat = LibConfig['format'];
export type BundleType = Boolean | 'excludeExternal';
export type BundleType = boolean | 'excludeExternal';

interface Options {
format?: LibFormat[];
Expand All @@ -21,8 +21,13 @@ function getRslibConfig(options: Options) {
};

const libs = format.map(libFormat => {
const lib = getLibShared(libFormat, bundle!);
const lib = getLibShared(libFormat, bundle);
if (libFormat === 'umd') {
if (!umdName) {
throw new Error(
'getRslibConfig: umdName is required when using UMD format',
);
}
lib.umdName = umdName;
lib.bundle = true;
}
Expand Down
1 change: 0 additions & 1 deletion packages/coze-js/rslib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export default defineConfig(
getRslibConfig({
format: ['esm', 'cjs', 'umd'],
bundle: 'excludeExternal',
umdName: 'CozeJs',
tsconfigPath: './tsconfig.build.json',
}),
);

0 comments on commit 1fd4cb6

Please sign in to comment.