<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current behavior</strong><br>
The (automatic) update of babel for 7.9 to 7.10 breaks PhantomJS.</p>
<p dir="auto"><strong>Possible Solution</strong><br>
Adding this to package.json fixed it until the next updates form other babel submodules broke it again.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  &quot;resolutions&quot;: {
    &quot;ember-cli-babel&quot;: &quot;7.19.0&quot;,
    &quot;@babel/core&quot;: &quot;7.9.6&quot;,
    &quot;@babel/generator&quot;: &quot;7.9.6&quot;,
    &quot;@babel/helpers&quot;: &quot;7.9.6&quot;,
    &quot;@babel/parser&quot;: &quot;7.9.6&quot;,
    &quot;@babel/template&quot;: &quot;7.8.6&quot;,
    &quot;@babel/traverse&quot;: &quot;7.9.6&quot;,
    &quot;@babel/types&quot;: &quot;7.9.6&quot;,
    &quot;@babel/compat-data&quot;: &quot;7.9.6&quot;,
    &quot;@babel/helper-compilation-targets&quot;: &quot;7.9.6&quot;,
    &quot;@babel/helper-create-class-features-plugin&quot;: &quot;7.9.6&quot;, 
    &quot;@babel/helper-member-expression-to-functions&quot;: &quot;7.8.3&quot;,
    &quot;@babel/helper-optimise-call-expression&quot;: &quot;7.8.3&quot;,
    &quot;@babel/helper-replace-supers&quot;: &quot;7.9.6&quot;, 
    &quot;@babel/plugin-proposal-decorators&quot;: &quot;7.8.3&quot;,
    &quot;@babel/plugin-proposal-json-strings&quot;: &quot;7.8.3&quot;,
    &quot;@babel/plugin-proposal-object-rest-spread&quot;: &quot;7.9.6&quot;, 
    &quot;@babel/plugin-proposal-optional-chaining&quot;: &quot;7.9.0&quot;,
    &quot;@babel/plugin-transform-block-scoping&quot;: &quot;7.8.3&quot;,
    &quot;@babel/plugin-transform-destructuring&quot;: &quot;7.9.5&quot;, 
    &quot;@babel/plugin-transform-for-of&quot;: &quot;7.9.0&quot;,
    &quot;@babel/plugin-transform-modules-systemjs&quot;: &quot;7.9.6&quot;,
    &quot;@babel/plugin-transform-runtime&quot;: &quot;7.9.6&quot;, 
    &quot;@babel/plugin-transform-spread&quot;: &quot;7.8.3&quot;,
    &quot;@babel/plugin-transform-typescript&quot;: &quot;7.9.6&quot;,
    &quot;@babel/preset-env&quot;: &quot;7.9.6&quot;, 
    &quot;@babel/runtime&quot;: &quot;7.9.6&quot;
  }"><pre class="notranslate"><code class="notranslate">  "resolutions": {
    "ember-cli-babel": "7.19.0",
    "@babel/core": "7.9.6",
    "@babel/generator": "7.9.6",
    "@babel/helpers": "7.9.6",
    "@babel/parser": "7.9.6",
    "@babel/template": "7.8.6",
    "@babel/traverse": "7.9.6",
    "@babel/types": "7.9.6",
    "@babel/compat-data": "7.9.6",
    "@babel/helper-compilation-targets": "7.9.6",
    "@babel/helper-create-class-features-plugin": "7.9.6", 
    "@babel/helper-member-expression-to-functions": "7.8.3",
    "@babel/helper-optimise-call-expression": "7.8.3",
    "@babel/helper-replace-supers": "7.9.6", 
    "@babel/plugin-proposal-decorators": "7.8.3",
    "@babel/plugin-proposal-json-strings": "7.8.3",
    "@babel/plugin-proposal-object-rest-spread": "7.9.6", 
    "@babel/plugin-proposal-optional-chaining": "7.9.0",
    "@babel/plugin-transform-block-scoping": "7.8.3",
    "@babel/plugin-transform-destructuring": "7.9.5", 
    "@babel/plugin-transform-for-of": "7.9.0",
    "@babel/plugin-transform-modules-systemjs": "7.9.6",
    "@babel/plugin-transform-runtime": "7.9.6", 
    "@babel/plugin-transform-spread": "7.8.3",
    "@babel/plugin-transform-typescript": "7.9.6",
    "@babel/preset-env": "7.9.6", 
    "@babel/runtime": "7.9.6"
  }
</code></pre></div>
<p dir="auto">re: <a href="https://github.com/sebmck/6to5/blob/master/lib/6to5/register.js#L11-13">https://github.com/sebmck/6to5/blob/master/lib/6to5/register.js#L11-13</a></p>
<p dir="auto">If I write a module using es6, I can't import it from another node project (using es6 or otherwise) unless I remove these lines or if I include the compiled source in the module, which doesn't always happen cleanly.</p>
<p dir="auto">Coffeescript uses special file extensions (<code class="notranslate">.coffee</code>, like your <code class="notranslate">.es6</code>) that solve this problem. To make it easy to require es6 modules, I propose either:</p>
<ul dir="auto">
<li><em>Only</em> allow requires to work on .es6, like coffeescript, and allow to run on node-modules;</li>
<li>Have <code class="notranslate">register</code> return a function that accepts options, so I can define a regex (or file extension, or both) for files that should be compiled.</li>
</ul>
<p dir="auto">I can make a PR if you think this is a good idea.</p>