File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ function createTsProgram({
6565 baseDir ,
6666 )
6767
68- debug ( `Creating program for root project: ${ baseDir } ` )
68+ debug ( `creating program for root project: ${ baseDir } ` )
6969 return createTsProgramFromParsedConfig ( {
7070 parsedConfig,
7171 fsSystem,
@@ -181,9 +181,17 @@ export function tscEmitCompiler(tscOptions: TscOptions): TscResult {
181181 // redirected output from a composite project build), the emit callback above
182182 // will never be invoked. In that case, fall back to the text of the source
183183 // file itself so that callers still receive a declaration string.
184- if ( ! dtsCode && file . isDeclarationFile ) {
185- debug ( 'nothing was emitted. fallback to sourceFile text.' )
186- dtsCode = file . getFullText ( )
184+ if ( ! dtsCode ) {
185+ debug ( 'nothing was emitted.' )
186+
187+ if ( file . isDeclarationFile ) {
188+ debug ( 'source file is a declaration file.' )
189+ dtsCode = file . getFullText ( )
190+ } else {
191+ console . warn (
192+ '[rolldown-plugin-dts] Warning: Failed to emit declaration file. Please try to enable `eager` option (`dts.eager` for tsdown).' ,
193+ )
194+ }
187195 }
188196
189197 return { code : dtsCode , map }
You can’t perform that action at this time.
0 commit comments