| 1 | module.exports = function (api) { |
| 2 | const targets = api.targets(); |
| 3 | |
| 4 | return { |
| 5 | plugins: [plugin], |
| 6 | }; |
| 7 | |
| 8 | function plugin({ types: t }) { |
| 9 | return { |
| 10 | visitor: { |
| 11 | Program(path) { |
| 12 | const output = t.stringLiteral(`preset: ${JSON.stringify(targets)}`); |
| 13 | path.pushContainer("body", output); |
| 14 | }, |
| 15 | }, |
| 16 | }; |
| 17 | } |
| 18 | }; |