MCPcopy
hub / github.com/rollup/rollup / validateOptionsForMultiChunkOutput

Function validateOptionsForMultiChunkOutput

src/Bundle.ts:276–314  ·  view source on GitHub ↗
(
	outputOptions: NormalizedOutputOptions,
	log: LogHandler
)

Source from the content-addressed store, hash-verified

274}
275
276function validateOptionsForMultiChunkOutput(
277 outputOptions: NormalizedOutputOptions,
278 log: LogHandler
279) {
280 if (outputOptions.format === 'umd' || outputOptions.format === 'iife')
281 return error(
282 logInvalidOption(
283 'output.format',
284 URL_OUTPUT_FORMAT,
285 'UMD and IIFE output formats are not supported for code-splitting builds',
286 outputOptions.format
287 )
288 );
289 if (typeof outputOptions.file === 'string')
290 return error(
291 logInvalidOption(
292 'output.file',
293 URL_OUTPUT_DIR,
294 'when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option'
295 )
296 );
297 if (outputOptions.sourcemapFile)
298 return error(
299 logInvalidOption(
300 'output.sourcemapFile',
301 URL_OUTPUT_SOURCEMAPFILE,
302 '"output.sourcemapFile" is only supported for single-file builds'
303 )
304 );
305 if (!outputOptions.amd.autoId && outputOptions.amd.id)
306 log(
307 LOGLEVEL_WARN,
308 logInvalidOption(
309 'output.amd.id',
310 URL_OUTPUT_AMD_ID,
311 'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead'
312 )
313 );
314}
315
316function getIncludedModules(modulesById: ReadonlyMap<string, Module | ExternalModule>): Module[] {
317 const includedModules: Module[] = [];

Callers 1

generateMethod · 0.85

Calls 3

errorFunction · 0.90
logInvalidOptionFunction · 0.90
logFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…