MCPcopy
hub / github.com/rollup/rollup / loadConfigFile

Function loadConfigFile

cli/run/loadConfigFile.ts:27–49  ·  view source on GitHub ↗
(
	fileName,
	commandOptions = {},
	watchMode = false
)

Source from the content-addressed store, hash-verified

25import type { LoadConfigFile } from './loadConfigFileType';
26
27export const loadConfigFile: LoadConfigFile = async (
28 fileName,
29 commandOptions = {},
30 watchMode = false
31) => {
32 const configs = await getConfigList(
33 getDefaultFromCjs(await getConfigFileExport(fileName, commandOptions, watchMode)),
34 commandOptions
35 );
36 const warnings = batchWarnings(commandOptions);
37 try {
38 const normalizedConfigs: MergedRollupOptions[] = [];
39 for (const config of configs) {
40 const options = await mergeOptions(config, watchMode, commandOptions, warnings.log);
41 await addCommandPluginsToInputOptions(options, commandOptions);
42 normalizedConfigs.push(options);
43 }
44 return { options: normalizedConfigs, warnings };
45 } catch (error_) {
46 warnings.flush();
47 throw error_;
48 }
49};
50
51async function getConfigFileExport(
52 fileName: string,

Callers 3

getConfigsFunction · 0.90
reloadConfigFileFunction · 0.90
index.jsFile · 0.85

Calls 7

mergeOptionsFunction · 0.90
getConfigListFunction · 0.85
getDefaultFromCjsFunction · 0.85
getConfigFileExportFunction · 0.85
batchWarningsFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…