@@ -162,29 +162,15 @@ export class GenerateTypesPlugin implements WebpackPluginInstance {
162162 logger . debug ( 'start generating types...' ) ;
163163 await generateTypesAPI ( { dtsManagerOptions } ) ;
164164 logger . debug ( 'generate types success!' ) ;
165- const config = dtsManagerOptions . remote . moduleFederationConfig ;
166- let zipPrefix = '' ;
167- if ( typeof config . manifest === 'object' && config . manifest . filePath ) {
168- zipPrefix = config . manifest . filePath ;
169- } else if (
170- typeof config . manifest === 'object' &&
171- config . manifest . fileName
172- ) {
173- zipPrefix = path . dirname ( config . manifest . fileName ) ;
174- } else if ( config . filename ) {
175- zipPrefix = path . dirname ( config . filename ) ;
176- }
177165
178166 if ( isProd ) {
179- const zipAssetName = path . join ( zipPrefix , zipName ) ;
180- const apiAssetName = path . join ( zipPrefix , apiFileName ) ;
181167 if (
182168 zipTypesPath &&
183- ! compilation . getAsset ( zipAssetName ) &&
169+ ! compilation . getAsset ( zipName ) &&
184170 fs . existsSync ( zipTypesPath )
185171 ) {
186172 compilation . emitAsset (
187- zipAssetName ,
173+ zipName ,
188174 new compiler . webpack . sources . RawSource (
189175 fs . readFileSync ( zipTypesPath ) ,
190176 false ,
@@ -194,11 +180,11 @@ export class GenerateTypesPlugin implements WebpackPluginInstance {
194180
195181 if (
196182 apiTypesPath &&
197- ! compilation . getAsset ( apiAssetName ) &&
183+ ! compilation . getAsset ( apiFileName ) &&
198184 fs . existsSync ( apiTypesPath )
199185 ) {
200186 compilation . emitAsset (
201- apiAssetName ,
187+ apiFileName ,
202188 new compiler . webpack . sources . RawSource (
203189 fs . readFileSync ( apiTypesPath ) ,
204190 false ,
@@ -212,11 +198,7 @@ export class GenerateTypesPlugin implements WebpackPluginInstance {
212198 } ;
213199 if ( zipTypesPath && fs . existsSync ( zipTypesPath ) ) {
214200 const zipContent = fs . readFileSync ( zipTypesPath ) ;
215- const zipOutputPath = path . join (
216- compiler . outputPath ,
217- zipPrefix ,
218- zipName ,
219- ) ;
201+ const zipOutputPath = path . join ( compiler . outputPath , zipName ) ;
220202 await new Promise < void > ( ( resolve , reject ) => {
221203 compiler . outputFileSystem . mkdir (
222204 path . dirname ( zipOutputPath ) ,
@@ -248,11 +230,7 @@ export class GenerateTypesPlugin implements WebpackPluginInstance {
248230
249231 if ( apiTypesPath && fs . existsSync ( apiTypesPath ) ) {
250232 const apiContent = fs . readFileSync ( apiTypesPath ) ;
251- const apiOutputPath = path . join (
252- compiler . outputPath ,
253- zipPrefix ,
254- apiFileName ,
255- ) ;
233+ const apiOutputPath = path . join ( compiler . outputPath , apiFileName ) ;
256234 await new Promise < void > ( ( resolve , reject ) => {
257235 compiler . outputFileSystem . mkdir (
258236 path . dirname ( apiOutputPath ) ,
0 commit comments