bublejs / buble

https://buble.surge.sh
MIT License
871 stars 64 forks source link

duplicated helpers #195

Open shirotech opened 5 years ago

shirotech commented 5 years ago

https://github.com/bublejs/buble/blob/ecc42f5685810a966bd53b77866028f5322ac7ac/src/index.js#L95

Each run a new Program object is created and causes helpers like objectWithoutProperties to be duplicated. This is the case when using the rollup plugin where each transforms will run the transform method.

https://github.com/bublejs/buble/blob/ecc42f5685810a966bd53b77866028f5322ac7ac/src/program/Program.js#L28

when this is null, the helper will be injected, this will always be null when we run transform. Is there a way to reuse it?

https://github.com/bublejs/buble/blob/ecc42f5685810a966bd53b77866028f5322ac7ac/src/program/Program.js#L63-L73