File tree 2 files changed +10
-1
lines changed
packages/dts-plugin/src/core/lib
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @module-federation/dts-plugin ' : patch
3
+ ---
4
+
5
+ use ` cwd ` to create Module Federation tsconfig
Original file line number Diff line number Diff line change @@ -62,13 +62,14 @@ function writeTempTsConfig(
62
62
tsConfig : TsConfigJson ,
63
63
context : string ,
64
64
name : string ,
65
+ cwd ?: string ,
65
66
) {
66
67
const createHash = ( contents : string ) => {
67
68
return crypto . createHash ( 'md5' ) . update ( contents ) . digest ( 'hex' ) ;
68
69
} ;
69
70
const hash = createHash ( `${ JSON . stringify ( tsConfig ) } ${ name } ${ Date . now ( ) } ` ) ;
70
71
const tempTsConfigJsonPath = resolve (
71
- context ,
72
+ cwd ?? context ,
72
73
'node_modules' ,
73
74
TEMP_DIR ,
74
75
`tsconfig.${ hash } .json` ,
@@ -170,6 +171,9 @@ export const compileTs = async (
170
171
tsConfig ,
171
172
remoteOptions . context ,
172
173
remoteOptions . moduleFederationConfig . name || 'mf' ,
174
+ typeof remoteOptions . moduleFederationConfig . dts !== 'boolean'
175
+ ? ( remoteOptions . moduleFederationConfig . dts ?. cwd ?? undefined )
176
+ : undefined ,
173
177
) ;
174
178
try {
175
179
const mfTypePath = retrieveMfTypesPath ( tsConfig , remoteOptions ) ;
You can’t perform that action at this time.
0 commit comments