Skip to content

Commit c86024c

Browse files
committed
fix: apply defaults after extending
1 parent 40270af commit c86024c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/loader.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ export async function loadConfig<T extends InputConfig=InputConfig> (opts: LoadC
8888
r.config = defu(
8989
opts.overrides,
9090
config,
91-
configRC,
92-
opts.defaults
91+
configRC
9392
) as T
9493

9594
// Allow extending
@@ -103,6 +102,11 @@ export async function loadConfig<T extends InputConfig=InputConfig> (opts: LoadC
103102
) as T
104103
}
105104

105+
// Apply defaults
106+
if (opts.defaults) {
107+
r.config = defu(r.config, opts.defaults) as T
108+
}
109+
106110
// Return resolved config
107111
return r
108112
}

0 commit comments

Comments
 (0)