MCPcopy
hub / github.com/rollup/rollup / transform

Function transform

test/cli/samples/log-side-effects/rollup.config.mjs:9–15  ·  view source on GitHub ↗
(code, id)

Source from the content-addressed store, hash-verified

7 {
8 name: 'insert-lines',
9 transform(code, id) {
10 if (id.endsWith('mapped.js')) {
11 const magicString = new MagicString(code);
12 magicString.prepend('const removed = true;\nconst alsoRemoved = true; ');
13 return { code: magicString.toString(), map: magicString.generateMap({ hires: true }) };
14 }
15 }
16 }
17 ]
18};

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…