MCPcopy
hub / github.com/rollup/rollup / getFormat

Function getFormat

src/utils/options/normalizeOutputOptions.ts:149–182  ·  view source on GitHub ↗
(config: OutputOptions)

Source from the content-addressed store, hash-verified

147};
148
149const getFormat = (config: OutputOptions): NormalizedOutputOptions['format'] => {
150 const configFormat = config.format;
151 switch (configFormat) {
152 case undefined:
153 case 'es':
154 case 'esm':
155 case 'module': {
156 return 'es';
157 }
158 case 'cjs':
159 case 'commonjs': {
160 return 'cjs';
161 }
162 case 'system':
163 case 'systemjs': {
164 return 'system';
165 }
166 case 'amd':
167 case 'iife':
168 case 'umd': {
169 return configFormat;
170 }
171 default: {
172 return error(
173 logInvalidOption(
174 'output.format',
175 URL_OUTPUT_FORMAT,
176 `Valid values are "amd", "cjs", "system", "es", "iife" or "umd"`,
177 configFormat
178 )
179 );
180 }
181 }
182};
183
184const getInlineDynamicImports = (
185 config: OutputOptions,

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…