Skip to content

Commit

Permalink
fix: ensure collect manual dts for js source files
Browse files Browse the repository at this point in the history
fix #184
  • Loading branch information
qmhc committed Jun 30, 2023
1 parent 9f03b6b commit 5b7c5e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,14 @@ export function dtsPlugin(options: PluginOptions = {}): import('vite').Plugin {
publicRoot = compilerOptions.rootDir
? ensureAbsolute(compilerOptions.rootDir, root)
: compilerOptions.composite && compilerOptions.configFilePath
? normalizePath(dirname(compilerOptions.configFilePath as string))
? dirname(compilerOptions.configFilePath as string)
: queryPublicPath(
program
.getSourceFiles()
.filter(maybeEmitted)
.map(sourceFile => sourceFile.fileName)
)
publicRoot = normalizePath(publicRoot)
entryRoot = entryRoot || publicRoot
entryRoot = ensureAbsolute(entryRoot, root)

Expand Down Expand Up @@ -307,7 +308,7 @@ export function dtsPlugin(options: PluginOptions = {}): import('vite').Plugin {
!program ||
!filter(id) ||
id.includes('.vue?vue') ||
(!tsRE.test(id) && !vueRE.test(id))
(!tjsRE.test(id) && !vueRE.test(id))
) {
return
}
Expand Down

0 comments on commit 5b7c5e5

Please sign in to comment.