Skip to content

Allow whitelist and blacklist options for runtime transformer definitions (T6904) #3934

@babel-bot

Description

@babel-bot

Issue originally made by @guybedford

Description

It would be nice to add a custom options whitelist and blacklist to the runtime transformer something like:

plugins: [['transform-runtime', { exclude: ['Promise', 'Array.*', 'Object.defineProperty'] }]]

Or an opt-in-only whitelist:

plugins: [['transform-runtime', { include: ['Object.assign', 'String.*', 'Math.*'] }]]

The specific use case that came up for me now was excluding the Promise polyfill in particular since SystemJS by default has a polyfill present already.

The nice thing is this would enable the creation of runtime transformer presets which can be based on various engine support baselines.

Metadata

Metadata

Assignees

Labels

Priority: Highhelp wantedoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions