File tree Expand file tree Collapse file tree 3 files changed +21
-7
lines changed
packages/dts-plugin/src/core/lib Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @module-federation/dts-plugin ' : patch
3
+ ---
4
+
5
+ fix: replace sourceEntry with index if the value is '.'
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import {
30
30
HOST_API_TYPES_FILE_NAME ,
31
31
} from '../constant' ;
32
32
import { fileLog } from '../../server' ;
33
- import { axiosGet } from './utils' ;
33
+ import { axiosGet , isDebugMode } from './utils' ;
34
34
35
35
export const MODULE_DTS_MANAGER_IDENTIFIER = 'MF DTS Manager' ;
36
36
@@ -157,11 +157,17 @@ class DTSManager {
157
157
fs . writeFileSync ( apiTypesPath , apiTypes ) ;
158
158
}
159
159
160
- if ( remoteOptions . deleteTypesFolder ) {
161
- await rm ( retrieveMfTypesPath ( tsConfig , remoteOptions ) , {
162
- recursive : true ,
163
- force : true ,
164
- } ) ;
160
+ try {
161
+ if ( remoteOptions . deleteTypesFolder ) {
162
+ await rm ( retrieveMfTypesPath ( tsConfig , remoteOptions ) , {
163
+ recursive : true ,
164
+ force : true ,
165
+ } ) ;
166
+ }
167
+ } catch ( err ) {
168
+ if ( isDebugMode ( ) ) {
169
+ console . error ( err ) ;
170
+ }
165
171
}
166
172
console . log ( ansiColors . green ( 'Federated types created correctly' ) ) ;
167
173
} catch ( error ) {
Original file line number Diff line number Diff line change @@ -89,7 +89,10 @@ const createHost = (
89
89
) ;
90
90
91
91
for ( const sourceFile of sourceFiles || [ ] ) {
92
- const sourceEntry = mapExposeToEntry [ normalize ( sourceFile . fileName ) ] ;
92
+ let sourceEntry = mapExposeToEntry [ normalize ( sourceFile . fileName ) ] ;
93
+ if ( sourceEntry === '.' ) {
94
+ sourceEntry = 'index' ;
95
+ }
93
96
if ( sourceEntry ) {
94
97
const mfeTypeEntry = join (
95
98
mfTypePath ,
You can’t perform that action at this time.
0 commit comments