Ensure that presets properly flatten their options.

This commit is contained in:
Logan Smyth 2018-08-16 17:35:23 -07:00
parent 3a399d1eb9
commit 25d2f59018

View File

@ -55,7 +55,21 @@ export type ConfigContext = {
/** /**
* Build a config chain for a given preset. * 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, arg: PresetInstance,
context: *, context: *,
) => * = makeChainWalker({ ) => * = makeChainWalker({