diff --git a/packages/babel-core/src/config/config-chain.js b/packages/babel-core/src/config/config-chain.js index e81ca81f74..ee48361708 100644 --- a/packages/babel-core/src/config/config-chain.js +++ b/packages/babel-core/src/config/config-chain.js @@ -55,7 +55,21 @@ export type ConfigContext = { /** * Build a config chain for a given preset. */ -export const buildPresetChain: ( +export function buildPresetChain( + arg: PresetInstance, + context: *, +): ConfigChain | null { + const chain = buildPresetChainWalker(arg, context); + if (!chain) return null; + + return { + plugins: dedupDescriptors(chain.plugins), + presets: dedupDescriptors(chain.presets), + options: chain.options, + }; +} + +export const buildPresetChainWalker: ( arg: PresetInstance, context: *, ) => * = makeChainWalker({