<p dir="auto">babel version beta.40<br>
babelrc config</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;presets&quot;: [
        [&quot;@babel/preset-env&quot;, {
            &quot;targets&quot;: {
                &quot;browsers&quot;: [&quot;last 2 versions&quot;, &quot;ie &gt;= 10&quot;],
            },
            &quot;useBuiltIns&quot;: &quot;usage&quot;,
        }],
        &quot;@babel/preset-react&quot;,
    ],"><pre class="notranslate"><code class="notranslate">"presets": [
        ["@babel/preset-env", {
            "targets": {
                "browsers": ["last 2 versions", "ie &gt;= 10"],
            },
            "useBuiltIns": "usage",
        }],
        "@babel/preset-react",
    ],
</code></pre></div>
<p dir="auto">babel will generate code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/*! no exports provided */
/*! all exports used */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

&quot;use strict&quot;;
Object.defineProperty(__webpack_exports__, &quot;__esModule&quot;, { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_core_js_modules_es6_object_set_prototype_of__ = __webpack_require__(/*! core-js/modules/es6.object.set-prototype-of */ &quot;./node_modules/core-js/modules/es6.object.set-prototype-of.js&quot;);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_core_js_modules_es6_object_set_prototype_of___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_core_js_modules_es6_object_set_prototype_of__);



Object.defineProperty(exports, &quot;__esModule&quot;, {
  value: true
});"><pre class="notranslate"><code class="notranslate">/*! no exports provided */
/*! all exports used */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_core_js_modules_es6_object_set_prototype_of__ = __webpack_require__(/*! core-js/modules/es6.object.set-prototype-of */ "./node_modules/core-js/modules/es6.object.set-prototype-of.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_core_js_modules_es6_object_set_prototype_of___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_core_js_modules_es6_object_set_prototype_of__);



Object.defineProperty(exports, "__esModule", {
  value: true
});
</code></pre></div>
<p dir="auto">It cause error <code class="notranslate">Uncaught (in promise) ReferenceError: exports is not defined.</code></p>
<p dir="auto">If i remove useBuiltIns<br>
babel will generate code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {

&quot;use strict&quot;;


Object.defineProperty(exports, &quot;__esModule&quot;, {
  value: true
});"><pre class="notranslate"><code class="notranslate">/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
</code></pre></div>
<p dir="auto">It is right but without harmony</p>
<p dir="auto">Here's my config:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;babel&quot;: {
    &quot;presets&quot;: [
      [
        &quot;@babel/preset-env&quot;,
        {
          &quot;targets&quot;: {
            &quot;node&quot;: &quot;4.0.0&quot;
          },
          &quot;useBuiltIns&quot;: &quot;usage&quot;,
          &quot;debug&quot;: true,
          &quot;shippedProposals&quot;: true
        }
      ]
    ]
  }
  &quot;devDependencies&quot;: {
    &quot;npm-run-all&quot;: &quot;^4.1.2&quot;,
    &quot;@babel/cli&quot;: &quot;^7.0.0-beta.40&quot;,
    &quot;@babel/core&quot;: &quot;^7.0.0-beta.40&quot;,
    &quot;@babel/preset-env&quot;: &quot;^7.0.0-beta.40&quot;,
    &quot;babel-core&quot;: &quot;^7.0.0-bridge.0&quot;,
    &quot;babel-jest&quot;: &quot;^22.4.1&quot;,
    &quot;jest&quot;: &quot;^22.4.2&quot;
  }
}"><pre class="notranslate"><code class="notranslate">{
  "babel": {
    "presets": [
      [
        "@babel/preset-env",
        {
          "targets": {
            "node": "4.0.0"
          },
          "useBuiltIns": "usage",
          "debug": true,
          "shippedProposals": true
        }
      ]
    ]
  }
  "devDependencies": {
    "npm-run-all": "^4.1.2",
    "@babel/cli": "^7.0.0-beta.40",
    "@babel/core": "^7.0.0-beta.40",
    "@babel/preset-env": "^7.0.0-beta.40",
    "babel-core": "^7.0.0-bridge.0",
    "babel-jest": "^22.4.1",
    "jest": "^22.4.2"
  }
}
</code></pre></div>
<p dir="auto">Here's debug output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
@babel/preset-env: `DEBUG` option

Using targets:
{
  &quot;node&quot;: &quot;4&quot;
}

Using modules transform: commonjs

Using plugins:
  transform-arrow-functions { &quot;node&quot;:&quot;4&quot; }
  transform-block-scoping { &quot;node&quot;:&quot;4&quot; }
@babel/preset-env: `DEBUG` option
  transform-classes { &quot;node&quot;:&quot;4&quot; }
  transform-destructuring { &quot;node&quot;:&quot;4&quot; }
  transform-for-of { &quot;node&quot;:&quot;4&quot; }
  transform-function-name { &quot;node&quot;:&quot;4&quot; }
  transform-object-super { &quot;node&quot;:&quot;4&quot; }
  transform-parameters { &quot;node&quot;:&quot;4&quot; }
  transform-spread { &quot;node&quot;:&quot;4&quot; }
  transform-sticky-regex { &quot;node&quot;:&quot;4&quot; }
  transform-unicode-regex { &quot;node&quot;:&quot;4&quot; }
  transform-new-target { &quot;node&quot;:&quot;4&quot; }
  transform-regenerator { &quot;node&quot;:&quot;4&quot; }
  transform-exponentiation-operator { &quot;node&quot;:&quot;4&quot; }
  transform-async-to-generator { &quot;node&quot;:&quot;4&quot; }
  transform-dotall-regex { &quot;node&quot;:&quot;4&quot; }
  proposal-async-generator-functions { &quot;node&quot;:&quot;4&quot; }

Using targets:
  proposal-object-rest-spread { &quot;node&quot;:&quot;4&quot; }
  proposal-optional-catch-binding { &quot;node&quot;:&quot;4&quot; }
  proposal-unicode-property-regex { &quot;node&quot;:&quot;4&quot; }

Using polyfills with `usage` option:
{
  &quot;node&quot;: &quot;4&quot;
}

Using modules transform: commonjs

Using plugins:
  transform-arrow-functions { &quot;node&quot;:&quot;4&quot; }
  transform-block-scoping { &quot;node&quot;:&quot;4&quot; }
  transform-classes { &quot;node&quot;:&quot;4&quot; }
  transform-destructuring { &quot;node&quot;:&quot;4&quot; }
  transform-for-of { &quot;node&quot;:&quot;4&quot; }
  transform-function-name { &quot;node&quot;:&quot;4&quot; }
  transform-object-super { &quot;node&quot;:&quot;4&quot; }
  transform-parameters { &quot;node&quot;:&quot;4&quot; }
  transform-spread { &quot;node&quot;:&quot;4&quot; }
  transform-sticky-regex { &quot;node&quot;:&quot;4&quot; }
  transform-unicode-regex { &quot;node&quot;:&quot;4&quot; }
  transform-new-target { &quot;node&quot;:&quot;4&quot; }
  transform-regenerator { &quot;node&quot;:&quot;4&quot; }
  transform-exponentiation-operator { &quot;node&quot;:&quot;4&quot; }
  transform-async-to-generator { &quot;node&quot;:&quot;4&quot; }
  transform-dotall-regex { &quot;node&quot;:&quot;4&quot; }
  proposal-async-generator-functions { &quot;node&quot;:&quot;4&quot; }
  proposal-object-rest-spread { &quot;node&quot;:&quot;4&quot; }
  proposal-optional-catch-binding { &quot;node&quot;:&quot;4&quot; }
  proposal-unicode-property-regex { &quot;node&quot;:&quot;4&quot; }

Using polyfills with `usage` option:

[./functionality/bin/index.js] Based on your code and targets, none were added.

[./functionality/index.js] Added following polyfills:
  es7.array.includes { &quot;node&quot;:&quot;4&quot; }
  regenerator-runtime { &quot;node&quot;:&quot;4&quot; }
  es6.promise { &quot;node&quot;:&quot;4&quot; }"><pre class="notranslate"><code class="notranslate">
@babel/preset-env: `DEBUG` option

Using targets:
{
  "node": "4"
}

Using modules transform: commonjs

Using plugins:
  transform-arrow-functions { "node":"4" }
  transform-block-scoping { "node":"4" }
@babel/preset-env: `DEBUG` option
  transform-classes { "node":"4" }
  transform-destructuring { "node":"4" }
  transform-for-of { "node":"4" }
  transform-function-name { "node":"4" }
  transform-object-super { "node":"4" }
  transform-parameters { "node":"4" }
  transform-spread { "node":"4" }
  transform-sticky-regex { "node":"4" }
  transform-unicode-regex { "node":"4" }
  transform-new-target { "node":"4" }
  transform-regenerator { "node":"4" }
  transform-exponentiation-operator { "node":"4" }
  transform-async-to-generator { "node":"4" }
  transform-dotall-regex { "node":"4" }
  proposal-async-generator-functions { "node":"4" }

Using targets:
  proposal-object-rest-spread { "node":"4" }
  proposal-optional-catch-binding { "node":"4" }
  proposal-unicode-property-regex { "node":"4" }

Using polyfills with `usage` option:
{
  "node": "4"
}

Using modules transform: commonjs

Using plugins:
  transform-arrow-functions { "node":"4" }
  transform-block-scoping { "node":"4" }
  transform-classes { "node":"4" }
  transform-destructuring { "node":"4" }
  transform-for-of { "node":"4" }
  transform-function-name { "node":"4" }
  transform-object-super { "node":"4" }
  transform-parameters { "node":"4" }
  transform-spread { "node":"4" }
  transform-sticky-regex { "node":"4" }
  transform-unicode-regex { "node":"4" }
  transform-new-target { "node":"4" }
  transform-regenerator { "node":"4" }
  transform-exponentiation-operator { "node":"4" }
  transform-async-to-generator { "node":"4" }
  transform-dotall-regex { "node":"4" }
  proposal-async-generator-functions { "node":"4" }
  proposal-object-rest-spread { "node":"4" }
  proposal-optional-catch-binding { "node":"4" }
  proposal-unicode-property-regex { "node":"4" }

Using polyfills with `usage` option:

[./functionality/bin/index.js] Based on your code and targets, none were added.

[./functionality/index.js] Added following polyfills:
  es7.array.includes { "node":"4" }
  regenerator-runtime { "node":"4" }
  es6.promise { "node":"4" }
</code></pre></div>
<p dir="auto">Why on earth does my <code class="notranslate">index.build.js</code> file have an import statment?</p>
<blockquote>
<p dir="auto">./functionality/index.js</p>
</blockquote>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import &quot;core-js/modules/es6.promise&quot;;

require(&quot;regenerator-runtime/runtime&quot;);

require(&quot;core-js/modules/es7.array.includes&quot;);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s">"core-js/modules/es6.promise"</span><span class="pl-kos">;</span>

<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"regenerator-runtime/runtime"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"core-js/modules/es7.array.includes"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>