File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed
packages/unplugin-dts/src Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -362,7 +362,7 @@ export interface PluginOptions {
362362 *
363363 * Can be an array to output to multiple directories.
364364 *
365- * Defaults to 'build.outDir' of the Vite config, or `outDir` of tsconfig.json if using Rollup .
365+ * The default is to use the out directory provided by the scaffold .
366366 */
367367 outDir? : string | string [],
368368
Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ export interface PluginOptions {
379379 *
380380 * 可以指定一个数组来输出到多个目录中
381381 *
382- * 默认为 Vite 配置的 'build.outDir',使用 Rollup 时为 tsconfig.json 的 `outDir`
382+ * 默认使用脚手架提供的输出目录
383383 */
384384 outDir? : string | string [],
385385
Original file line number Diff line number Diff line change @@ -32,15 +32,15 @@ export interface CreateRuntimeOptions {
3232 /**
3333 * Specify root directory.
3434 *
35- * Defaults to the ' root' of the Vite config, or `process.cwd()` if using Rollup .
35+ * The default is to use the root provided by the scaffold; if none is provided, it defaults to `process.cwd()`.
3636 */
3737 root : string ,
3838 /**
3939 * Output directory for declaration files.
4040 *
4141 * Can be an array to output to multiple directories.
4242 *
43- * Defaults to 'build.outDir' of the Vite config, or `outDir` of tsconfig.json if using Rollup .
43+ * The default is to use the out directory provided by the scaffold .
4444 */
4545 outDirs ?: string | string [ ] ,
4646 /**
Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ export const pluginFactory: UnpluginFactory<PluginOptions | undefined> = /* #__P
120120 indexName = `${ ( fileName || 'index' ) } .d.ts`
121121 }
122122
123+ if ( ! options . outDirs && compiler . options . output . path ) {
124+ outDirs = [ ensureAbsolute ( compiler . options . output . path , root ) ]
125+ }
126+
123127 handleDebug ( 'parse webpack(rspack) config' )
124128 }
125129
You can’t perform that action at this time.
0 commit comments