File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ const result = await Bun.build({
1111
1212 plugins : [
1313 dts ( {
14- rootDir : `${ import . meta. dir } /src` ,
1514 cwd : import . meta. dir ,
1615 } ) ,
1716 ] ,
Original file line number Diff line number Diff line change @@ -25,20 +25,24 @@ interface DtsOptions {
2525export async function generate ( entryPoints : string | string [ ] , options ?: DtsOptions ) {
2626 const path = p . resolve ( options ?. tsconfigPath ?? 'tsconfig.json' )
2727 const configJson = ts . readConfigFile ( path , ts . sys . readFile ) . config
28+ const cwd = options ?. cwd ?? process . cwd ( )
29+ const rootDir = options ?. rootDir ?? `${ cwd } /src`
30+ const outDir = options ?. outdir ?? 'dist/types'
31+ const declarationMap = options ?. withSourceMap ?? false
2832
2933 const opts : TsOptions = {
30- rootDir : options ?. rootDir ?? options ?. cwd ?? process . cwd ( ) ,
34+ rootDir,
35+ outDir,
36+ declarationMap,
3137 declaration : true ,
3238 emitDeclarationOnly : true ,
3339 noEmit : false ,
34- outDir : options ?. outdir ?? 'dist/types' ,
35- declarationMap : options ?. withSourceMap ?? false ,
3640 }
3741
3842 const parsedConfig = ts . parseJsonConfigFileContent (
3943 configJson ,
4044 ts . sys ,
41- options ?. cwd ?? process . cwd ( ) ,
45+ cwd ,
4246 opts ,
4347 path ,
4448 )
You can’t perform that action at this time.
0 commit comments