Skip to content

Commit fc1209c

Browse files
committed
fix: remove passing projectReferences to program
fix #279
1 parent 5488231 commit fc1209c

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

src/plugin.ts

+16-11
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
import {
2222
ensureAbsolute,
2323
ensureArray,
24-
fileTypesPath,
24+
findTypesPath,
2525
isNativeObj,
2626
isRegExp,
2727
normalizePath,
@@ -169,10 +169,13 @@ export function dtsPlugin(options: PluginOptions = {}): import('vite').Plugin {
169169
: config.build.lib.entry
170170

171171
if (Array.isArray(input)) {
172-
entries = input.reduce((prev, current) => {
173-
prev[basename(current)] = current
174-
return prev
175-
}, {} as Record<string, string>)
172+
entries = input.reduce(
173+
(prev, current) => {
174+
prev[basename(current)] = current
175+
return prev
176+
},
177+
{} as Record<string, string>
178+
)
176179
} else {
177180
entries = { ...input }
178181
}
@@ -213,10 +216,13 @@ export function dtsPlugin(options: PluginOptions = {}): import('vite').Plugin {
213216
const input = typeof options.input === 'string' ? [options.input] : options.input
214217

215218
if (Array.isArray(input)) {
216-
entries = input.reduce((prev, current) => {
217-
prev[basename(current)] = current
218-
return prev
219-
}, {} as Record<string, string>)
219+
entries = input.reduce(
220+
(prev, current) => {
221+
prev[basename(current)] = current
222+
return prev
223+
},
224+
{} as Record<string, string>
225+
)
220226
} else {
221227
entries = { ...input }
222228
}
@@ -314,7 +320,6 @@ export function dtsPlugin(options: PluginOptions = {}): import('vite').Plugin {
314320
program = createProgram({
315321
host,
316322
rootNames,
317-
projectReferences: content?.projectReferences,
318323
options: compilerOptions
319324
})
320325

@@ -565,7 +570,7 @@ export function dtsPlugin(options: PluginOptions = {}): import('vite').Plugin {
565570
} catch (e) {}
566571

567572
const entryNames = Object.keys(entries)
568-
const types = fileTypesPath(pkg.publishConfig, pkg)
573+
const types = findTypesPath(pkg.publishConfig, pkg)
569574
const multiple = entryNames.length > 1
570575

571576
const cleanPath = (path: string) => {

src/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ export function toCapitalCase<T extends string>(value: T) {
323323
) as CapitalCase<T>
324324
}
325325

326-
export function fileTypesPath(...pkgs: Record<any, any>[]) {
326+
export function findTypesPath(...pkgs: Record<any, any>[]) {
327327
let path: string
328328

329329
for (const pkg of pkgs) {

0 commit comments

Comments
 (0)