Skip to content

Commit 129eee0

Browse files
Update website/docs/zh/config/lib/out-base.mdx
Co-authored-by: Timeless0911 <[email protected]>
1 parent 18802c9 commit 129eee0

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

packages/core/src/config.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -967,15 +967,13 @@ const composeEntryConfig = async (
967967
const resolvedEntries: Record<string, string> = {};
968968

969969
const resolveOutBase = async (resolvedEntryFiles: string[]) => {
970+
if (userOutBase !== undefined) {
971+
return path.resolve(root, userOutBase);
972+
}
970973
// Similar to `rootDir` in tsconfig and `outbase` in esbuild.
971-
const lcp = await calcLongestCommonPath(resolvedEntryFiles);
972-
// Using the longest common path of all non-declaration input files by default.
973-
const outBase = userOutBase
974-
? path.resolve(root, userOutBase)
975-
: lcp === null
976-
? root
977-
: lcp;
978-
return outBase;
974+
// Using the longest common path of all non-declaration input files if not specified.
975+
const lcp = (await calcLongestCommonPath(resolvedEntryFiles)) ?? root;
976+
return lcp;
979977
};
980978

981979
for (const key of Object.keys(entries)) {

website/docs/zh/config/lib/out-base.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
└── index.ts
2929
```
3030

31-
如果未指定输出基础目录,则默认使用所有输入入口点路径的最近公共祖先目录,即 `src/utils`,最终的文件输出结构为:
31+
如果未指定基础输出目录,则默认使用所有输入入口文件路径的最近公共祖先目录,即 `src/utils`,最终的文件输出结构为:
3232

3333
```txt
3434
dist

0 commit comments

Comments
 (0)