Skip to content

Commit

Permalink
refactor: rename mergeConfig parameters (#6144)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 16, 2021
1 parent a08b4c5 commit 5f39c28
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,13 +666,13 @@ function resolveBaseUrl(
}

function mergeConfigRecursively(
a: Record<string, any>,
b: Record<string, any>,
defaults: Record<string, any>,
overrides: Record<string, any>,
rootPath: string
) {
const merged: Record<string, any> = { ...a }
for (const key in b) {
const value = b[key]
const merged: Record<string, any> = { ...defaults }
for (const key in overrides) {
const value = overrides[key]
if (value == null) {
continue
}
Expand Down Expand Up @@ -710,11 +710,11 @@ function mergeConfigRecursively(
}

export function mergeConfig(
a: Record<string, any>,
b: Record<string, any>,
defaults: Record<string, any>,
overrides: Record<string, any>,
isRoot = true
): Record<string, any> {
return mergeConfigRecursively(a, b, isRoot ? '' : '.')
return mergeConfigRecursively(defaults, overrides, isRoot ? '' : '.')
}

function mergeAlias(a: AliasOptions = [], b: AliasOptions = []): Alias[] {
Expand Down

0 comments on commit 5f39c28

Please sign in to comment.