Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Support whitelist option for external helpers #91

Closed
sorgloomer opened this issue Oct 16, 2016 · 2 comments
Closed

Support whitelist option for external helpers #91

sorgloomer opened this issue Oct 16, 2016 · 2 comments

Comments

@sorgloomer
Copy link
Contributor

The babel-core function buildExternalHelpers supports a whitelist option (see https://github.com/babel/babel/blob/master/packages/babel-core/src/tools/build-external-helpers.js#L86), which is currently not used in this plugin (see https://github.com/rollup/rollup-plugin-babel/blob/master/src/index.js#L40).

Currently the asyncGenerator babel helper function is always included in the bundle, it does not get tree-shaken out, I guess because it's hard to detect the initialization does not have side effects. It could be worked around by enabling users to whitelist only specific helpers. It could even be made automatic later.

babel-core: v6.17.0
rollup-plugin-babel: v2.6.1
@sorgloomer
Copy link
Contributor Author

sorgloomer commented Oct 16, 2016

This came up at StackOverflow. (http://stackoverflow.com/questions/40022087/using-the-whitelist-option-with-babels-external-helpers)

I created a pull request #92 with a quick workaround, however I am not sure about what the long-term solution should be.

@Rich-Harris
Copy link
Contributor

Closing now that #92 is merged and released – thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants