@@ -27,11 +27,12 @@ export async function emitDts(
2727  const  start  =  Date . now ( ) ; 
2828  const  {  configPath,  declarationDir,  name,  dtsExtension,  banner,  footer }  = 
2929    options ; 
30+   const  configFileParseResult  =  loadTsconfig ( configPath ) ; 
3031  const  { 
3132    options : rawCompilerOptions , 
3233    fileNames, 
3334    projectReferences, 
34-   }  =  loadTsconfig ( configPath ) ; 
35+   }  =  configFileParseResult ; 
3536
3637  const  compilerOptions  =  { 
3738    ...rawCompilerOptions , 
@@ -49,6 +50,9 @@ export async function emitDts(
4950      options : compilerOptions , 
5051      projectReferences, 
5152      host, 
53+       configFileParsingDiagnostics : ts . getConfigFileParsingDiagnostics ( 
54+         configFileParseResult , 
55+       ) , 
5256    } ) ; 
5357
5458    const  emitResult  =  program . emit ( ) ; 
@@ -60,7 +64,7 @@ export async function emitDts(
6064    const  diagnosticMessages : string [ ]  =  [ ] ; 
6165
6266    for  ( const  diagnostic  of  allDiagnostics )  { 
63-       const  fileLoc  =  getFileLoc ( diagnostic ) ; 
67+       const  fileLoc  =  getFileLoc ( diagnostic ,   configPath ) ; 
6468      const  message  =  `${ fileLoc }   - ${ color . red ( 'error' ) }   ${ color . gray ( `TS${ diagnostic . code }  :` ) }   ${ ts . flattenDiagnosticMessageText (  
6569        diagnostic . messageText ,  
6670        host . getNewLine ( ) ,  
@@ -94,7 +98,7 @@ export async function emitDts(
9498    } ; 
9599
96100    const  reportDiagnostic  =  ( diagnostic : ts . Diagnostic )  =>  { 
97-       const  fileLoc  =  getFileLoc ( diagnostic ) ; 
101+       const  fileLoc  =  getFileLoc ( diagnostic ,   configPath ) ; 
98102
99103      logger . error ( 
100104        `${ fileLoc }   - ${ color . red ( 'error' ) }   ${ color . gray ( `TS${ diagnostic . code }  :` ) }  ` , 
0 commit comments