Skip to content

Commit 8c30d63

Browse files
committed
chore: update
1 parent 17c761c commit 8c30d63

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

packages/plugin-dts/src/tsc.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)