File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -270,14 +270,20 @@ export async function redirectDtsImports(
270
270
) ;
271
271
272
272
if ( isOutsideRootdir ) {
273
- const relativePath = relative ( dirname ( dtsFile ) , absoluteImportPath ) ;
273
+ const relativePath = path . posix . relative (
274
+ dirname ( dtsFile ) ,
275
+ absoluteImportPath ,
276
+ ) ;
274
277
redirectImportPath = relativePath . startsWith ( '..' )
275
278
? relativePath
276
279
: `./${ relativePath } ` ;
277
280
} else {
278
281
const originalFilePath = resolve ( rootDir , relative ( outDir , dtsFile ) ) ;
279
282
const originalSourceDir = dirname ( originalFilePath ) ;
280
- const relativePath = relative ( originalSourceDir , absoluteImportPath ) ;
283
+ const relativePath = path . posix . relative (
284
+ originalSourceDir ,
285
+ absoluteImportPath ,
286
+ ) ;
281
287
redirectImportPath = relativePath . startsWith ( '..' )
282
288
? relativePath
283
289
: `./${ relativePath } ` ;
@@ -312,7 +318,7 @@ export async function redirectDtsImports(
312
318
}
313
319
}
314
320
315
- code . overwrite ( start , end , normalize ( redirectImportPath ) ) ;
321
+ code . overwrite ( start , end , redirectImportPath ) ;
316
322
} catch ( err ) {
317
323
logger . debug ( err ) ;
318
324
}
You can’t perform that action at this time.
0 commit comments