File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { blue } from 'ansis'
55import { createDefu } from 'defu'
66import isInCi from 'is-in-ci'
77import { createDebug } from 'obug'
8+ import { parseTsconfig } from 'rolldown-plugin-dts/internal'
89import { resolveClean } from '../features/clean.ts'
910import { resolveDepsConfig } from '../features/deps.ts'
1011import { resolveEntry } from '../features/entry.ts'
@@ -171,9 +172,16 @@ export async function resolveUserConfig(
171172 exe = resolveFeatureOption ( exe , { } )
172173
173174 if ( dts == null ) {
174- dts = exe
175- ? false
176- : ! ! ( pkg ?. types || pkg ?. typings || hasExportsTypes ( pkg ?. exports ) )
175+ if ( exe ) {
176+ dts = false
177+ } else if ( pkg ?. types || pkg ?. typings || hasExportsTypes ( pkg ?. exports ) ) {
178+ dts = true
179+ } else if ( tsconfig ) {
180+ const parsed = parseTsconfig ( tsconfig )
181+ dts = ! ! parsed . compilerOptions ?. declaration
182+ } else {
183+ dts = false
184+ }
177185 }
178186 dts = resolveFeatureOption ( dts , { } )
179187
You can’t perform that action at this time.
0 commit comments