<p dir="auto">I have two pieces of logically identical code below with differences only in the order of class definitions. However, that resulted in two different ways being used to define the <code class="notranslate">defineProperty</code> method in the compiled output.</p>
<p dir="auto"><strong>Version 1</strong> compiled into:<br>
<code class="notranslate">import _Object$defineProperty from "babel-runtime/core-js/object/define-property";</code></p>
<p dir="auto"><strong>Version 2</strong> compiled into:<br>
<code class="notranslate">var _defineProperty = require("babel-runtime/core-js/object/define-property");</code></p>

<h3 dir="auto">Input Code</h3>


<p dir="auto"><strong>Version 1</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

class Test2 {}
class Test1 {
  async test() {}
}"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-k">class</span> <span class="pl-v">Test2</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-k">class</span> <span class="pl-v">Test1</span> <span class="pl-kos">{</span>
  <span class="pl-k">async</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Version 2</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

class Test1 {
  async test() {}
}
class Test2 {}"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-k">class</span> <span class="pl-v">Test1</span> <span class="pl-kos">{</span>
  <span class="pl-k">async</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">class</span> <span class="pl-v">Test2</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Babel/Babylon Configuration (.babelrc, package.json, cli command)</h3>

<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// .babelrc
{
  &quot;presets&quot;: [&quot;env&quot;, &quot;stage-2&quot;],
  &quot;plugins&quot;: [
    [&quot;transform-runtime&quot;, {
      &quot;helpers&quot;: false,
      &quot;polyfill&quot;: true,
      &quot;moduleName&quot;: &quot;babel-runtime&quot;
    }]
  ]
}"><pre class="notranslate"><span class="pl-c">// .babelrc</span>
<span class="pl-kos">{</span>
  <span class="pl-s">"presets"</span>: <span class="pl-kos">[</span><span class="pl-s">"env"</span><span class="pl-kos">,</span> <span class="pl-s">"stage-2"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-s">"plugins"</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">[</span><span class="pl-s">"transform-runtime"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
      <span class="pl-s">"helpers"</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
      <span class="pl-s">"polyfill"</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
      <span class="pl-s">"moduleName"</span>: <span class="pl-s">"babel-runtime"</span>
    <span class="pl-kos">}</span><span class="pl-kos">]</span>
  <span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Expected Behavior</h3>


<p dir="auto">The two different versions of the code here should be compiled in the same way.</p>
<h3 dir="auto">Current Behavior</h3>


<p dir="auto">Compiled <strong>Version 1</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

import _Object$defineProperty from &quot;babel-runtime/core-js/object/define-property&quot;;

var _promise = require(&quot;babel-runtime/core-js/promise&quot;);
var _promise2 = _interopRequireDefault(_promise);
var _regenerator = require(&quot;babel-runtime/regenerator&quot;);
var _regenerator2 = _interopRequireDefault(_regenerator);

/* ... skipping the rest of the file */"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-k">import</span> <span class="pl-s1">_Object$defineProperty</span> <span class="pl-k">from</span> <span class="pl-s">"babel-runtime/core-js/object/define-property"</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-s1">_promise</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-runtime/core-js/promise"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_promise2</span> <span class="pl-c1">=</span> <span class="pl-en">_interopRequireDefault</span><span class="pl-kos">(</span><span class="pl-s1">_promise</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_regenerator</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-runtime/regenerator"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_regenerator2</span> <span class="pl-c1">=</span> <span class="pl-en">_interopRequireDefault</span><span class="pl-kos">(</span><span class="pl-s1">_regenerator</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">/* ... skipping the rest of the file */</span></pre></div>
<p dir="auto">Compiled <strong>Version 2</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

var _promise = require(&quot;babel-runtime/core-js/promise&quot;);
var _promise2 = _interopRequireDefault(_promise);
var _defineProperty = require(&quot;babel-runtime/core-js/object/define-property&quot;);
var _defineProperty2 = _interopRequireDefault(_defineProperty);
var _regenerator = require(&quot;babel-runtime/regenerator&quot;);
var _regenerator2 = _interopRequireDefault(_regenerator);

/* ... skipping the rest of the file */"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-s1">_promise</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-runtime/core-js/promise"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_promise2</span> <span class="pl-c1">=</span> <span class="pl-en">_interopRequireDefault</span><span class="pl-kos">(</span><span class="pl-s1">_promise</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_defineProperty</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-runtime/core-js/object/define-property"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_defineProperty2</span> <span class="pl-c1">=</span> <span class="pl-en">_interopRequireDefault</span><span class="pl-kos">(</span><span class="pl-s1">_defineProperty</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_regenerator</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-runtime/regenerator"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_regenerator2</span> <span class="pl-c1">=</span> <span class="pl-en">_interopRequireDefault</span><span class="pl-kos">(</span><span class="pl-s1">_regenerator</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">/* ... skipping the rest of the file */</span></pre></div>
<h3 dir="auto">Your Environment</h3>

<table role="table">
<thead>
<tr>
<th>software</th>
<th>version(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babel</td>
<td>6.26.0</td>
</tr>
<tr>
<td>node</td>
<td>6.10.3</td>
</tr>
<tr>
<td>npm</td>
<td>3.10.10</td>
</tr>
<tr>
<td>Operating System</td>
<td>macOS 10.12.6</td>
</tr>
</tbody>
</table>
<h3 dir="auto"><g-emoji class="g-emoji" alias="computer" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4bb.png">💻</g-emoji></h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Would you like to work on a fix?</li>
</ul>
<h3 dir="auto">How are you using Babel?</h3>
<p dir="auto">babel-loader (webpack)</p>
<h3 dir="auto">Input code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="no code"><pre class="notranslate"><span class="pl-s1">no</span> <span class="pl-s1">code</span></pre></div>
<h3 dir="auto">Configuration file name</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Configuration</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Current and expected behavior</h3>
<p dir="auto">If I install newest preset-env with npm, I have to install plugin-syntax-dynamic-import  manually due to plugin-syntax-dynamic-import in both dependencies and devDependencies.</p>
<p dir="auto">update 2021-09-07<br>
Seem like duplicate dependency didn't cause my problem, but we still need to delete plugin-syntax-dynamic-import in devDependencies.</p>
<h3 dir="auto">Environment</h3>
<p dir="auto">System:<br>
OS: macOS 11.5.2<br>
Binaries:<br>
Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node<br>
Yarn: 1.22.10 - /usr/local/bin/yarn<br>
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm<br>
npmPackages:<br>
@babel/preset-env: ^7.15.0 =&gt; 7.15.0<br>
@babel/runtime: 7.1.2 =&gt; 7.1.2<br>
babel-eslint: 8.2.6 =&gt; 8.2.6<br>
babel-helper-vue-jsx-merge-props: 2.0.3 =&gt; 2.0.3<br>
babel-loader: ^8.0.5 =&gt; 8.2.2</p>
<h3 dir="auto">Possible solution</h3>
<p dir="auto">delete plugin-syntax-dynamic-import in devDependencies</p>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><em>No response</em></p>