polen
Version:
A framework for delightful GraphQL developer portals
24 lines • 934 B
JavaScript
import { debugPolen } from '#singletons/debug';
import { normalizeInput } from '../config/configurator.js';
import { load } from '../config/load.js';
import { mergeInputs } from '../config/merge.js';
import { toViteUserConfig } from './vite.js';
export const fromFile = async (options) => {
const configInput = await load(options);
const configInputMerged = mergeInputs(configInput, options.overrides);
const config = await fromMemory(configInputMerged, options.dir);
debugPolen(`resolved config`, config);
return config;
};
export const fromMemory = async (input,
/**
* Refer to `baseRootDirPath` parameter on {@link normalizeInput}.
*
* @default `process.cwd()`
*/
baseRootDirPath) => {
const configNormalized = await normalizeInput(input, baseRootDirPath ?? process.cwd());
const viteUserConfig = toViteUserConfig(configNormalized);
return viteUserConfig;
};
//# sourceMappingURL=resolve.js.map