MCPcopy
hub / github.com/rollup/rollup / getFile

Function getFile

src/utils/options/normalizeOutputOptions.ts:121–147  ·  view source on GitHub ↗
(
	config: OutputOptions,
	preserveModules: boolean,
	inputOptions: NormalizedInputOptions
)

Source from the content-addressed store, hash-verified

119}
120
121const getFile = (
122 config: OutputOptions,
123 preserveModules: boolean,
124 inputOptions: NormalizedInputOptions
125): NormalizedOutputOptions['file'] => {
126 const { file } = config;
127 if (typeof file === 'string') {
128 if (preserveModules) {
129 return error(
130 logInvalidOption(
131 'output.file',
132 URL_OUTPUT_DIR,
133 'you must set "output.dir" instead of "output.file" when using the "output.preserveModules" option'
134 )
135 );
136 }
137 if (!Array.isArray(inputOptions.input))
138 return error(
139 logInvalidOption(
140 'output.file',
141 URL_OUTPUT_DIR,
142 'you must set "output.dir" instead of "output.file" when providing named inputs'
143 )
144 );
145 }
146 return file;
147};
148
149const getFormat = (config: OutputOptions): NormalizedOutputOptions['format'] => {
150 const configFormat = config.format;

Callers 1

normalizeOutputOptionsFunction · 0.85

Calls 2

errorFunction · 0.90
logInvalidOptionFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…