File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -164,15 +164,38 @@ export async function emitDts(
164164 }
165165 } else {
166166 // incremental build with project references
167+ let errorNumber = 0 ;
168+ const reportErrorSummary = ( errorCount : number ) => {
169+ errorNumber = errorCount ;
170+ } ;
171+
167172 const host = ts . createSolutionBuilderHost (
168173 system ,
169174 createProgram ,
170175 reportDiagnostic ,
176+ undefined ,
177+ reportErrorSummary ,
171178 ) ;
172179
173180 const solutionBuilder = ts . createSolutionBuilder ( host , [ configPath ] , { } ) ;
174181
175182 solutionBuilder . build ( ) ;
183+
184+ await processDtsFiles (
185+ bundle ,
186+ declarationDir ,
187+ dtsExtension ,
188+ banner ,
189+ footer ,
190+ ) ;
191+
192+ if ( errorNumber > 0 ) {
193+ logger . error (
194+ `Failed to emit declaration files. ${ color . gray ( `(${ name } )` ) } ` ,
195+ ) ;
196+
197+ throw new Error ( 'DTS generation failed' ) ;
198+ }
176199 }
177200
178201 logger . ready (
You can’t perform that action at this time.
0 commit comments