(code: string)
| 13 | }) |
| 14 | |
| 15 | async 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 | } |
no test coverage detected