File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -98,9 +98,10 @@ export const pluginDts = (options: PluginDtsOptions = {}): RsbuildPlugin => ({
9898 }
9999
100100 const tsConfigResult = loadTsconfig ( tsconfigPath ) ;
101+ const compilerOptions = tsConfigResult . options ;
101102 const dtsEmitPath =
102103 options . distPath ??
103- tsConfigResult . options . declarationDir ??
104+ compilerOptions . declarationDir ??
104105 config . output ?. distPath ?. root ;
105106
106107 const jsExtension = extname ( __filename ) ;
@@ -123,7 +124,13 @@ export const pluginDts = (options: PluginDtsOptions = {}): RsbuildPlugin => ({
123124 }
124125
125126 // clean tsbuildinfo file
126- await cleanTsBuildInfoFile ( tsconfigPath , tsConfigResult ) ;
127+ if (
128+ compilerOptions . composite ||
129+ compilerOptions . incremental ||
130+ options . build
131+ ) {
132+ await cleanTsBuildInfoFile ( tsconfigPath , tsConfigResult ) ;
133+ }
127134
128135 const dtsGenOptions : DtsGenOptions = {
129136 ...options ,
Original file line number Diff line number Diff line change @@ -263,5 +263,7 @@ export async function cleanTsBuildInfoFile(
263263 }
264264 }
265265
266- await fsP . rm ( tsbuildInfoFilePath , { force : true } ) ;
266+ if ( await pathExists ( tsbuildInfoFilePath ) ) {
267+ await fsP . rm ( tsbuildInfoFilePath , { force : true } ) ;
268+ }
267269}
You can’t perform that action at this time.
0 commit comments