File tree 2 files changed +7
-9
lines changed
website/docs/zh/config/lib
2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -967,15 +967,13 @@ const composeEntryConfig = async (
967
967
const resolvedEntries : Record < string , string > = { } ;
968
968
969
969
const resolveOutBase = async ( resolvedEntryFiles : string [ ] ) => {
970
+ if ( userOutBase !== undefined ) {
971
+ return path . resolve ( root , userOutBase ) ;
972
+ }
970
973
// 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 ;
979
977
} ;
980
978
981
979
for ( const key of Object . keys ( entries ) ) {
Original file line number Diff line number Diff line change 28
28
└── index.ts
29
29
```
30
30
31
- 如果未指定输出基础目录,则默认使用所有输入入口点路径的最近公共祖先目录 ,即 ` src/utils ` ,最终的文件输出结构为:
31
+ 如果未指定基础输出目录,则默认使用所有输入入口文件路径的最近公共祖先目录 ,即 ` src/utils ` ,最终的文件输出结构为:
32
32
33
33
``` txt
34
34
dist
You can’t perform that action at this time.
0 commit comments