Skip to content

Commit

Permalink
fix: added syntactic and semantic diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
gcaaa31928 committed Mar 17, 2024
1 parent 2c90382 commit 45f555a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/plugin.ts
Expand Up @@ -425,6 +425,13 @@ export function dtsPlugin(options: PluginOptions = {}): import('vite').Plugin {
const sourceFile = program.getSourceFile(id)

if (sourceFile) {
const diagnostics = [
...service.getSemanticDiagnostics(sourceFile.fileName),
...service.getSyntacticDiagnostics(sourceFile.fileName)
]
if (diagnostics.length) {
logger.warn(ts.formatDiagnosticsWithColorAndContext(diagnostics, host))
}
for (const outputFile of service.getEmitOutput(sourceFile.fileName, true).outputFiles) {
outputFiles.set(
resolve(publicRoot, relative(outDir, ensureAbsolute(outputFile.name, outDir))),
Expand Down

0 comments on commit 45f555a

Please sign in to comment.