From 496870f2072bfbf09cb78a400320863876c949fb Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Thu, 8 Aug 2024 19:54:36 +0800 Subject: [PATCH] chore: update --- packages/plugin-dts/src/apiExtractor.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/plugin-dts/src/apiExtractor.ts b/packages/plugin-dts/src/apiExtractor.ts index 0426f6750..81a49e6bf 100644 --- a/packages/plugin-dts/src/apiExtractor.ts +++ b/packages/plugin-dts/src/apiExtractor.ts @@ -24,7 +24,10 @@ export async function bundleDts(options: BundleOptions): Promise { cwd, outDir, dtsExtension, - dtsEntry, + dtsEntry = { + name: 'index', + path: 'index.d.ts', + }, tsconfigPath = 'tsconfig.json', } = options; try { @@ -32,9 +35,9 @@ export async function bundleDts(options: BundleOptions): Promise { const untrimmedFilePath = join( cwd, relative(cwd, outDir), - `${dtsEntry.name ?? 'index'}${dtsExtension}`, + `${dtsEntry.name}${dtsExtension}`, ); - const mainEntryPointFilePath = dtsEntry.path ?? 'index.d.ts'; + const mainEntryPointFilePath = dtsEntry.path; const internalConfig = { mainEntryPointFilePath, // TODO: use !externals