<p dir="auto">.babelrc<br>
{<br>
"presets": [<br>
[<br>
"@babel/preset-env",<br>
{<br>
"modules": false,<br>
"targets": {<br>
"browsers": ["&gt; 1%", "last 2 versions", "not ie &lt;= 8"]<br>
}<br>
}<br>
]<br>
],<br>
"plugins": [<br>
"@babel/plugin-proposal-object-rest-spread",<br>
"@babel/plugin-transform-runtime",<br>
"@babel/plugin-syntax-dynamic-import",<br>
"@babel/plugin-syntax-import-meta",<br>
[<br>
"@babel/plugin-proposal-decorators",<br>
{<br>
"legacy": true<br>
}<br>
],<br>
"@babel/plugin-proposal-class-properties",<br>
"@babel/plugin-proposal-json-strings",<br>
"@babel/plugin-proposal-function-sent",<br>
"@babel/plugin-proposal-export-namespace-from",<br>
"@babel/plugin-proposal-numeric-separator",<br>
"@babel/plugin-proposal-throw-expressions",<br>
"@babel/plugin-transform-arrow-functions",<br>
"@babel/plugin-transform-block-scoping",<br>
"@babel/plugin-transform-classes"<br>
]<br>
}</p>
<p dir="auto">webpack<br>
image<br>
image</p>
<blockquote>
<p dir="auto">Issue originally made by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/guybedford/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/guybedford">@guybedford</a></p>
</blockquote>
<h3 dir="auto">Description</h3>
<p dir="auto">It would be nice to add a custom options whitelist and blacklist to the runtime transformer something like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="plugins: [['transform-runtime', { exclude: ['Promise', 'Array.*', 'Object.defineProperty'] }]]"><pre class="notranslate"><code class="notranslate">plugins: [['transform-runtime', { exclude: ['Promise', 'Array.*', 'Object.defineProperty'] }]]
</code></pre></div>
<p dir="auto">Or an opt-in-only whitelist:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="plugins: [['transform-runtime', { include: ['Object.assign', 'String.*', 'Math.*'] }]]"><pre class="notranslate"><code class="notranslate">plugins: [['transform-runtime', { include: ['Object.assign', 'String.*', 'Math.*'] }]]
</code></pre></div>
<p dir="auto">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.</p>
<p dir="auto">The nice thing is this would enable the creation of runtime transformer presets which can be based on various engine support baselines.</p>