<h3 dir="auto">Bug report</h3>
<p dir="auto">Babel is running translations on files which are inside ignored folder(s)</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Ignore everything inside ignored folder(s)</p>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">Babel translates items inside the folder if it finds things that tell babel to translate is</p>
<h3 dir="auto">Possible Solution</h3>
<p dir="auto">Properly ignore folders, don't even check inside them</p>
<h3 dir="auto">Context</h3>
<p dir="auto">Cross-linking reference: <a href="https://github.com/hueniverse/hawk/issues/227" data-hovercard-type="issue" data-hovercard-url="/mozilla/hawk/issues/227/hovercard">hawk#277</a></p>
<p dir="auto">Basically we have our src folder in our repo, and our dist repo (uncommitted). The build server runs yarn in the src folder, runs all unit tests inside of it.<br>
If this completes it runs babel translation with the following .babelrc</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;ignore&quot;: [
    &quot;node_modules&quot;,
    &quot;test&quot;
  ],
  &quot;plugins&quot;: [
    &quot;transform-async-to-generator&quot;,
    &quot;transform-runtime&quot;
  ],
  &quot;presets&quot;: [&quot;es2015&quot;]
}"><pre class="notranslate"><code class="notranslate">{
  "ignore": [
    "node_modules",
    "test"
  ],
  "plugins": [
    "transform-async-to-generator",
    "transform-runtime"
  ],
  "presets": ["es2015"]
}
</code></pre></div>
<p dir="auto">However, taking a look in my build server, I can see the following log:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="src/folder1/handler.js -&gt; dist/folder1/handler.js
src/folder2/handler.js -&gt; dist/folder1/handler.js
...
src/node_modules/hawk/client.js -&gt; dist/node_modules/hawk/client.js
src/node_modules/hawk/dist/browser.js -&gt; dist/node_modules/hawk/dist/browser.js
src/node_modules/hawk/lib/browser.js -&gt; dist/node_modules/hawk/lib/browser.js
src/node_modules/hawk/lib/client.js -&gt; dist/node_modules/hawk/lib/client.js
src/node_modules/hawk/lib/crypto.js -&gt; dist/node_modules/hawk/lib/crypto.js
src/node_modules/hawk/lib/index.js -&gt; dist/node_modules/hawk/lib/index.js
src/node_modules/hawk/lib/server.js -&gt; dist/node_modules/hawk/lib/server.js
src/node_modules/hawk/lib/utils.js -&gt; dist/node_modules/hawk/lib/utils.js
...
src/folder_last/index.js -&gt; dist/folder_last/index.js"><pre class="notranslate"><code class="notranslate">src/folder1/handler.js -&gt; dist/folder1/handler.js
src/folder2/handler.js -&gt; dist/folder1/handler.js
...
src/node_modules/hawk/client.js -&gt; dist/node_modules/hawk/client.js
src/node_modules/hawk/dist/browser.js -&gt; dist/node_modules/hawk/dist/browser.js
src/node_modules/hawk/lib/browser.js -&gt; dist/node_modules/hawk/lib/browser.js
src/node_modules/hawk/lib/client.js -&gt; dist/node_modules/hawk/lib/client.js
src/node_modules/hawk/lib/crypto.js -&gt; dist/node_modules/hawk/lib/crypto.js
src/node_modules/hawk/lib/index.js -&gt; dist/node_modules/hawk/lib/index.js
src/node_modules/hawk/lib/server.js -&gt; dist/node_modules/hawk/lib/server.js
src/node_modules/hawk/lib/utils.js -&gt; dist/node_modules/hawk/lib/utils.js
...
src/folder_last/index.js -&gt; dist/folder_last/index.js
</code></pre></div>
<p dir="auto">Hawk has the following items which (I think) is causing this issue:<br>
<code class="notranslate">.babelrc</code></p>
<p dir="auto">Hawk already has said they will not fix this issue, and technically, this is a babel issue imho.</p>
<h2 dir="auto">Feature Request</h2>
<p dir="auto">This is related to @babel/preset-env and @babel/runtime</p>
<p dir="auto">useBuiltIns:usage is a great feature that helps avoiding unnecessary polyfills. The drawback though is that other libraries still import core-js explicitly. Because of that, I usually have many core-js modules imported twice:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/671158/49209551-77454200-f3c3-11e8-9477-8bf9848da71f.png"><img src="https://user-images.githubusercontent.com/671158/49209551-77454200-f3c3-11e8-9477-8bf9848da71f.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Once as /core-js/modules (via @babel/runtime with 'useBuiltIns:usage') and the second time as /core-js/library/modules</p>
<p dir="auto">I assume there should be the way to avoid that. Like, for @babel/runtime to import core-js as /core-js/library/modules or programmatically detect polyfills that are already imported</p>