@@ -39,12 +39,12 @@ const asyncDispose: typeof Symbol.asyncDispose =
3939 * Build with tsdown.
4040 */
4141export async function build (
42- userOptions : InlineConfig = { } ,
42+ inlineConfig : InlineConfig = { } ,
4343) : Promise < TsdownBundle [ ] > {
44- globalLogger . level = userOptions . logLevel || 'info'
45- const { configs, files : configFiles } = await resolveConfig ( userOptions )
44+ globalLogger . level = inlineConfig . logLevel || 'info'
45+ const { configs, files : configFiles } = await resolveConfig ( inlineConfig )
4646
47- return buildWithConfigs ( configs , configFiles )
47+ return buildWithConfigs ( configs , configFiles , ( ) => build ( inlineConfig ) )
4848}
4949
5050/**
@@ -56,6 +56,7 @@ export async function build(
5656export async function buildWithConfigs (
5757 configs : ResolvedConfig [ ] ,
5858 configFiles : string [ ] ,
59+ _restart : ( ) => void ,
5960) : Promise < TsdownBundle [ ] > {
6061 let cleanPromise : Promise < void > | undefined
6162 const clean = ( ) => {
@@ -71,7 +72,7 @@ export async function buildWithConfigs(
7172
7273 await Promise . all ( disposeCbs . map ( ( cb ) => cb ( ) ) )
7374 clearRequireCache ( )
74- buildWithConfigs ( configs , configFiles )
75+ _restart ( )
7576 }
7677
7778 const configChunksByPkg = initBundleByPkg ( configs )
0 commit comments