Skip to content

Commit

Permalink
Update website/docs/zh/config/lib/out-base.mdx
Browse files Browse the repository at this point in the history
Co-authored-by: Timeless0911 <[email protected]>
  • Loading branch information
fi3ework and Timeless0911 committed Feb 11, 2025
1 parent 18802c9 commit 129eee0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -967,15 +967,13 @@ const composeEntryConfig = async (
const resolvedEntries: Record<string, string> = {};

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

for (const key of Object.keys(entries)) {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/zh/config/lib/out-base.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
└── index.ts
```

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

```txt
dist
Expand Down

0 comments on commit 129eee0

Please sign in to comment.