@@ -46,11 +46,15 @@ const wildcardExternalsPlugin = (peerDependencies) => ({
4646const moveTypescriptDeclarationsPlugin = ( packagePath ) => ( {
4747 name : 'move-ts-declarations' ,
4848 writeBundle : async ( ) => {
49- const files = glob . sync ( path . join ( packagePath , 'dist' , '*' , 'assets' , 'src' , '**/*.d.ts' ) ) ;
49+ const isBridge = packagePath . includes ( 'src/Bridge' ) ;
50+ const globPattern = isBridge
51+ ? path . join ( packagePath , 'dist' , packagePath . replace ( / ^ s r c \/ / , '' ) , '**/*.d.ts' )
52+ : path . join ( packagePath , 'dist' , '*' , 'assets' , 'src' , '**/*.d.ts' )
53+ const files = glob . sync ( globPattern ) ;
5054 files . forEach ( ( file ) => {
51- // a bit odd, but remove first 7 directories, which will leave
55+ // a bit odd, but remove first 7 or 13 directories, which will leave
5256 // only the relative path to the file
53- const relativePath = file . split ( '/' ) . slice ( 7 ) . join ( '/' ) ;
57+ const relativePath = file . split ( '/' ) . slice ( isBridge ? 13 : 7 ) . join ( '/' ) ;
5458
5559 const targetFile = path . join ( packagePath , 'dist' , relativePath ) ;
5660 if ( ! fs . existsSync ( path . dirname ( targetFile ) ) ) {
0 commit comments