MCPcopy
hub / github.com/rollup/rollup / normalizeOutputOptions

Function normalizeOutputOptions

src/utils/options/normalizeOutputOptions.ts:33–119  ·  view source on GitHub ↗
(
	config: OutputOptions,
	inputOptions: NormalizedInputOptions,
	unsetInputOptions: ReadonlySet<string>
)

Source from the content-addressed store, hash-verified

31} from './options';
32
33export async function normalizeOutputOptions(
34 config: OutputOptions,
35 inputOptions: NormalizedInputOptions,
36 unsetInputOptions: ReadonlySet<string>
37): Promise<{ options: NormalizedOutputOptions; unsetOptions: Set<string> }> {
38 // These are options that may trigger special warnings or behaviour later
39 // if the user did not select an explicit value
40 const unsetOptions = new Set(unsetInputOptions);
41
42 const compact = config.compact || false;
43 const format = getFormat(config);
44 const inlineDynamicImports = getInlineDynamicImports(config, inputOptions);
45 const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions);
46 const file = getFile(config, preserveModules, inputOptions);
47 const generatedCode = getGeneratedCode(config);
48 const externalImportAttributes = getExternalImportAttributes(config, inputOptions);
49
50 const outputOptions: NormalizedOutputOptions & OutputOptions = {
51 amd: getAmd(config),
52 assetFileNames: config.assetFileNames ?? 'assets/[name]-[hash][extname]',
53 banner: getAddon(config, 'banner'),
54 chunkFileNames: config.chunkFileNames ?? '[name]-[hash].js',
55 compact,
56 dir: getDir(config, file),
57 dynamicImportInCjs: config.dynamicImportInCjs ?? true,
58 entryFileNames: getEntryFileNames(config, unsetOptions),
59 esModule: config.esModule ?? 'if-default-prop',
60 experimentalMinChunkSize: config.experimentalMinChunkSize ?? 1,
61 exports: getExports(config, unsetOptions),
62 extend: config.extend || false,
63 externalImportAssertions: externalImportAttributes,
64 externalImportAttributes,
65 externalLiveBindings: config.externalLiveBindings ?? true,
66 file,
67 footer: getAddon(config, 'footer'),
68 format,
69 freeze: config.freeze ?? true,
70 generatedCode,
71 globals: config.globals || {},
72 hashCharacters: config.hashCharacters ?? 'base64',
73 hoistTransitiveImports: config.hoistTransitiveImports ?? true,
74 importAttributesKey: config.importAttributesKey ?? 'assert',
75 indent: getIndent(config, compact),
76 inlineDynamicImports,
77 interop: getInterop(config),
78 intro: getAddon(config, 'intro'),
79 manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules),
80 minifyInternalExports: getMinifyInternalExports(config, format, compact),
81 name: config.name,
82 noConflict: config.noConflict || false,
83 onlyExplicitManualChunks: config.onlyExplicitManualChunks || false,
84 outro: getAddon(config, 'outro'),
85 paths: config.paths || {},
86 plugins: await normalizePluginOption(config.plugins),
87 preserveModules,
88 preserveModulesRoot: getPreserveModulesRoot(config),
89 reexportProtoFromExternal: config.reexportProtoFromExternal ?? true,
90 sanitizeFileName:

Callers 1

getOutputOptionsFunction · 0.90

Calls 15

normalizePluginOptionFunction · 0.90
warnUnknownOptionsFunction · 0.90
getFormatFunction · 0.85
getInlineDynamicImportsFunction · 0.85
getPreserveModulesFunction · 0.85
getFileFunction · 0.85
getGeneratedCodeFunction · 0.85
getAmdFunction · 0.85
getAddonFunction · 0.85
getDirFunction · 0.85
getEntryFileNamesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…