MCPcopy Index your code
hub / github.com/rollup/plugins / getCode

Function getCode

util/test.js:8–23  ·  view source on GitHub ↗
(bundle, outputOptions, allFiles = false)

Source from the content-addressed store, hash-verified

6 * @param {import('rollup').OutputOptions} [outputOptions]
7 */
8const getCode = async (bundle, outputOptions, allFiles = false) => {
9 const { output } = await bundle.generate(outputOptions || { format: 'cjs', exports: 'auto' });
10
11 if (allFiles) {
12 return output.map(({ code, fileName, source, map }) => {
13 return {
14 code,
15 fileName,
16 source,
17 map
18 };
19 });
20 }
21 const [{ code }] = output;
22 return code;
23};
24
25/**
26 * @param {import('rollup').RollupBuild} bundle

Callers 15

testBundleFunction · 0.90
test.mjsFile · 0.90
test.mjsFile · 0.90
test.mjsFile · 0.90
side-effects.mjsFile · 0.90
test.mjsFile · 0.90
tslib.jsFile · 0.90
declarations.jsFile · 0.90
generateFunction · 0.90
generateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected