MCPcopy Create free account
hub / github.com/danielroe/rollup-plugin-pure / transform

Function transform

test/plugin.bench.ts:15–33  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

13})
14
15async function transform(code: string) {
16 const filename = 'index.ts'
17 const bundle = await rollup({
18 input: filename,
19 plugins: [
20 {
21 name: 'entry',
22 resolveId: id => (id === filename) ? id : undefined,
23 load: id => id === filename ? code : undefined,
24 },
25 PluginPure({
26 functions: ['defineComponent', '$createConfig', 'hashStyleFunction'],
27 include: [/index\.ts/],
28 }),
29 ],
30 })
31 const { output } = await bundle.generate({})
32 return output[0].code
33}

Callers 1

plugin.bench.tsFile · 0.85

Calls 1

PluginPureFunction · 0.90

Tested by

no test coverage detected