File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 11import { defineConfig , LibConfig } from '@rslib/core' ;
22
33type LibFormat = LibConfig [ 'format' ] ;
4- export type BundleType = Boolean | 'excludeExternal' ;
4+ export type BundleType = boolean | 'excludeExternal' ;
55
66interface 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 }
Original file line number Diff line number Diff 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) ;
You can’t perform that action at this time.
0 commit comments