MCPcopy
hub / github.com/vitejs/vite / mergeConfig

Function mergeConfig

packages/vite/src/node/utils.ts:1509–1522  ·  view source on GitHub ↗
(
  defaults: D extends Function ? never : D,
  overrides: O extends Function ? never : O,
  isRoot = true,
)

Source from the content-addressed store, hash-verified

1507}
1508
1509export function mergeConfig<
1510 D extends Record<string, any>,
1511 O extends Record<string, any>,
1512>(
1513 defaults: D extends Function ? never : D,
1514 overrides: O extends Function ? never : O,
1515 isRoot = true,
1516): Record<string, any> {
1517 if (typeof defaults === 'function' || typeof overrides === 'function') {
1518 throw new Error(`Cannot merge config in form of callback`)
1519 }
1520
1521 return mergeConfigRecursively(defaults, overrides, isRoot ? '' : '.')
1522}
1523
1524export function mergeAlias(
1525 a?: AliasOptions,

Callers 13

resolveConfigFunction · 0.90
createWorkerPluginsFunction · 0.90
runConfigHookFunction · 0.90
runConfigEnvironmentHookFunction · 0.90
constructorMethod · 0.90
config.tsFile · 0.90
runnerImportFunction · 0.90
restartServerFunction · 0.90
constructorMethod · 0.90
config.spec.tsFile · 0.90
loadConfigFunction · 0.90
startDefaultServeFunction · 0.90

Calls 1

mergeConfigRecursivelyFunction · 0.85

Tested by

no test coverage detected