<p dir="auto">In documentation it is written:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
    Plugins run before Presets.
    Plugin ordering is first to last.
    Preset ordering is reversed (last to first)."><pre class="notranslate"><code class="notranslate">
    Plugins run before Presets.
    Plugin ordering is first to last.
    Preset ordering is reversed (last to first).
</code></pre></div>
<p dir="auto">I wrote my own plugin which works with const and let. It works good, but when I use "es2015" preset, my plugin does not work because all const and let become var. Why does my plugin run after presets?<br>
Here is my babel config:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [
    &quot;es2015&quot;
  ],
  &quot;plugins&quot;: [
    &quot;./babel-plugin-transform-const-name&quot;
  ]
}"><pre class="notranslate"><code class="notranslate">{
  "presets": [
    "es2015"
  ],
  "plugins": [
    "./babel-plugin-transform-const-name"
  ]
}
</code></pre></div>
<p dir="auto">And I use "babel-cli": "^6.18.0"</p>
<blockquote>
<p dir="auto">Issue originally made by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kaigth/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kaigth">@kaigth</a></p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> 6.1.18</li>
<li><strong>Node version:</strong> 5.0.0</li>
<li><strong>npm version:</strong> 3.3.9</li>
</ul>
<h3 dir="auto">Input code</h3>
<p dir="auto">npm pre-reqs "5.0.0"</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;babel&quot;: &quot;^6.1.18&quot;,
&quot;babel-core&quot;: &quot;^6.1.21&quot;,
&quot;babel-loader&quot;: &quot;^6.2.0&quot;,
&quot;babel-plugin-transform-runtime&quot;: &quot;^6.1.18&quot;,
&quot;babel-polyfill&quot;: &quot;^6.1.19&quot;,
&quot;babel-preset-es2015&quot;: &quot;^6.1.18&quot;,
&quot;babel-preset-stage-0&quot;: &quot;^6.1.18&quot;,
&quot;babel-runtime&quot;: &quot;^6.1.21&quot;"><pre class="notranslate"><code class="notranslate">"babel": "^6.1.18",
"babel-core": "^6.1.21",
"babel-loader": "^6.2.0",
"babel-plugin-transform-runtime": "^6.1.18",
"babel-polyfill": "^6.1.19",
"babel-preset-es2015": "^6.1.18",
"babel-preset-stage-0": "^6.1.18",
"babel-runtime": "^6.1.21"
</code></pre></div>
<p dir="auto">webpack: "^1.9.7"</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="loaders: [
      {
        test: /\.js$/,
        exclude: /node_modules|public|app\/vendor/,
        loader: 'babel-loader',
        query: {
          presets: ['es2015', 'stage-0']
        }
      }
]"><pre class="notranslate"><code class="notranslate">loaders: [
      {
        test: /\.js$/,
        exclude: /node_modules|public|app\/vendor/,
        loader: 'babel-loader',
        query: {
          presets: ['es2015', 'stage-0']
        }
      }
]
</code></pre></div>
<p dir="auto">top of app:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="require('babel-polyfill');

export default class someClass {
 constructor() {
}

async _loadData() {
    try {
      const response = await this._loadJSON('content');
      console.log(response);
    } catch (error) {
      throw error;
    }
  }
}"><pre class="notranslate"><code class="notranslate">require('babel-polyfill');

export default class someClass {
 constructor() {
}

async _loadData() {
    try {
      const response = await this._loadJSON('content');
      console.log(response);
    } catch (error) {
      throw error;
    }
  }
}
</code></pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">Seems to be a dependency issue with the 2015 transform classes module when running npm 3 or greater.  The error <code class="notranslate">regeneratorRuntime is not defined</code> occurs.  Seems it's not loading the runtime sub dependency properly.  Issue goes away when rolling back to <code class="notranslate">"babel-plugin-transform-es2015-classes": "6.1.21"</code> in npm while still using the latest babel.</p>
<p dir="auto">Sorry for the lack of clarification. The issue happens when exporting a new class and calling a new es7 feature such as async or await. Input code was updated to reflect changes.</p>
<p dir="auto">I also attempted to run the polyfill in the entry file before app and the issue still exists.</p>