<h1 dir="auto">Bug report</h1>
<h2 dir="auto">Describe the bug</h2>
<p dir="auto">Whenever I do <code class="notranslate">npm run build</code> it doesn't remove the old files from previous builds inside the .next folder. This eventually causes the <code class="notranslate">.next/server/static/</code> folder to have a lot of folders of the old builds. Is this intended?</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Steps to reproduce the behavior, please provide code snippets or a repository:</p>
<ol dir="auto">
<li><code class="notranslate">npm run build</code></li>
<li>Open <code class="notranslate">.next/server/static</code></li>
<li><code class="notranslate">npm run build</code> multiple times</li>
<li>New folders are generated (with the respective BUILD_ID), but the old folders for the previous builds aren't deleted.</li>
<li><code class="notranslate">npm run dev</code></li>
<li><code class="notranslate">.next</code> is rebuilt from the ground up, which deletes old builds</li>
<li>But if you never <code class="notranslate">npm run dev</code>, the old build folders stay there. Which is usually the case for projects in production servers</li>
</ol>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">Old build folders should be deleted right? (on development environments it's okay since <code class="notranslate">npm run dev</code> resets it, but on production environments these folders will start to pile up)</p>
<p dir="auto">I just checked one of my servers and saw a bunch of these unnecessary folders. In this server i would <code class="notranslate">git pull</code>, <code class="notranslate">npm run build &amp;&amp; pm2 restart [pm2 name]</code>. So it eventually accumulated a bunch of these</p>
<h2 dir="auto">Screenshots</h2>
<p dir="auto">All the previous builds are still in the folder, <code class="notranslate">XB7kfZi8MyFj3pO7k5iSZ</code> is the current build as seen in the <code class="notranslate">BUILD_ID</code> file</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/12690211/61912865-1d643000-aef0-11e9-8282-392dee08d042.png"><img src="https://user-images.githubusercontent.com/12690211/61912865-1d643000-aef0-11e9-8282-392dee08d042.png" alt="Screen Shot 2019-07-25 at 3 22 58 PM" style="max-width: 100%;"></a></p>
<h2 dir="auto">System information</h2>
<ul dir="auto">
<li>OS: macOS</li>
<li>Version of Next.js: 9.0.0 (also tested on 8.0.3)</li>
</ul>
<h1 dir="auto">Bug report</h1>
<h2 dir="auto">Describe the bug</h2>
<p dir="auto"><code class="notranslate">core-js</code> is getting loaded in my bundles, multiple times actually, both in my <code class="notranslate">main.js</code> file and my <code class="notranslate">_app.js</code> file, and I have no use for it.</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">It's the default behavior, the default hello-world example should reproduce this.</p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">There should be a way to get rid of <code class="notranslate">core-js</code> from my bundles, as I don't even need to target old browsers. How do I do that?</p>
<p dir="auto">I've tried setting the following <code class="notranslate">.babelrc</code> file and <code class="notranslate">core-js</code> is still getting loaded:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [
    [&quot;next/babel&quot;, {
      &quot;preset-env&quot;: {
        &quot;useBuiltIns&quot;: false,
        &quot;targets&quot;: {
          &quot;chrome&quot;: 76,
          &quot;node&quot;: 11
        }
      },
      &quot;transform-runtime&quot;: {
        &quot;corejs&quot;: false
      }
    }]
  ]
}"><pre class="notranslate">{
  <span class="pl-ent">"presets"</span>: [
    [<span class="pl-s"><span class="pl-pds">"</span>next/babel<span class="pl-pds">"</span></span>, {
      <span class="pl-ent">"preset-env"</span>: {
        <span class="pl-ent">"useBuiltIns"</span>: <span class="pl-c1">false</span>,
        <span class="pl-ent">"targets"</span>: {
          <span class="pl-ent">"chrome"</span>: <span class="pl-c1">76</span>,
          <span class="pl-ent">"node"</span>: <span class="pl-c1">11</span>
        }
      },
      <span class="pl-ent">"transform-runtime"</span>: {
        <span class="pl-ent">"corejs"</span>: <span class="pl-c1">false</span>
      }
    }]
  ]
}</pre></div>