@@ -27,7 +27,7 @@ const external = [
27
27
'@emotion/react/jsx-runtime' ,
28
28
'@emotion/react/jsx-dev-runtime' ,
29
29
'@mui/material' ,
30
- ' @mui/material/styles' ,
30
+ / @ m u i \ /m a t e r i a l \/ . * / ,
31
31
'copy-to-clipboard' ,
32
32
'zustand' ,
33
33
'zustand/context' ,
@@ -48,7 +48,9 @@ const outputMatrix = (
48
48
format,
49
49
banner : `/// <reference types="./${ baseName } .d.ts" />` ,
50
50
globals : external . reduce ( ( object , module ) => {
51
- object [ module ] = module
51
+ if ( typeof module === 'string' ) {
52
+ object [ module ] = module
53
+ }
52
54
return object
53
55
} , { } as Record < string , string > )
54
56
} ) )
@@ -102,6 +104,20 @@ const buildMatrix = (input: string, output: string, config: {
102
104
runtime : 'automatic' ,
103
105
importSource : '@emotion/react'
104
106
}
107
+ } ,
108
+ experimental : {
109
+ plugins : config . browser
110
+ ? [ ]
111
+ : [
112
+ [
113
+ '@swc/plugin-transform-imports' ,
114
+ {
115
+ '@mui/material' : {
116
+ transform : '@mui/material/{{member}}'
117
+ }
118
+ }
119
+ ]
120
+ ]
105
121
}
106
122
}
107
123
} ) )
@@ -125,7 +141,7 @@ const dtsMatrix = (): RollupOptions[] => {
125
141
126
142
const build : RollupOptions [ ] = [
127
143
buildMatrix ( './src/index.tsx' , 'index' , {
128
- format : [ 'es' , 'umd ' ] ,
144
+ format : [ 'es' , 'cjs ' ] ,
129
145
browser : false ,
130
146
dts : true
131
147
} ) ,
0 commit comments