<p dir="auto">How can I insert functions via import into a .js file?</p>
<p dir="auto"><strong>My source test script (test.js):</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import anime from 'animejs';
import flatpickr from &quot;flatpickr&quot;;

const eee = 'test-eee';
console.log(eee);"><pre class="notranslate"><code class="notranslate">import anime from 'animejs';
import flatpickr from "flatpickr";

const eee = 'test-eee';
console.log(eee);
</code></pre></div>
<p dir="auto">I use <a href="https://www.npmjs.com/package/gulp-babel" rel="nofollow">gulp-babel</a> as JavaScript Transpiler.</p>
<p dir="auto"><strong>My babel devDependencies.</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    &quot;@babel/core&quot;: &quot;^7.2.2&quot;,
    &quot;@babel/helper-module-imports&quot;: &quot;^7.0.0&quot;,
    &quot;@babel/plugin-transform-modules-commonjs&quot;: &quot;^7.2.0&quot;,
    &quot;@babel/preset-env&quot;: &quot;^7.2.3&quot;"><pre class="notranslate"><code class="notranslate">    "@babel/core": "^7.2.2",
    "@babel/helper-module-imports": "^7.0.0",
    "@babel/plugin-transform-modules-commonjs": "^7.2.0",
    "@babel/preset-env": "^7.2.3"
</code></pre></div>
<p dir="auto"><strong>My .babelrc:</strong></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;debug&quot;: true,
        &quot;modules&quot;: false
      }
    ]
  ],
  &quot;plugins&quot;: [
    [
      &quot;@babel/plugin-transform-modules-commonjs&quot;, {
        &quot;noInterop&quot;: true
      }
    ]
  ]
}"><pre class="notranslate"><code class="notranslate">{
  "presets": [
    [
      "@babel/preset-env", {
        "debug": true,
        "modules": false
      }
    ]
  ],
  "plugins": [
    [
      "@babel/plugin-transform-modules-commonjs", {
        "noInterop": true
      }
    ]
  ]
}
</code></pre></div>
<p dir="auto"><strong>After I started the gulp task I get the following:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

var _animejs = require(&quot;animejs&quot;);

var _flatpickr = require(&quot;flatpickr&quot;);

var eee = 'test-eee';
console.log(eee);"><pre class="notranslate"><code class="notranslate">"use strict";

var _animejs = require("animejs");

var _flatpickr = require("flatpickr");

var eee = 'test-eee';
console.log(eee);
</code></pre></div>
<h3 dir="auto">But now animejs and flatpickr should be included in the file.</h3>
<p dir="auto">Ran <code class="notranslate">babel-doctor</code> and am getting these errors. How would I fix this? Not sure where babel-runtime would be.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="✖ Found these duplicate packages:

- babel-runtime x 23
- babel-template x 7
- babel-traverse x 14
- babel-types x 11
- babel-helper-define-map x 1
- babel-helper-function-name x 2
- babel-helper-replace-supers x 1
- babel-helper-regex x 1
- babel-messages x 15
- babel-helper-get-function-arity x 3
- babel-code-frame x 15
- babel-helper-optimise-call-expression x 1

Recommend running `npm dedupe`

✖ We found some outdated packages:

- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29

Found potential issues on your machine :("><pre class="notranslate"><code class="notranslate">✖ Found these duplicate packages:

- babel-runtime x 23
- babel-template x 7
- babel-traverse x 14
- babel-types x 11
- babel-helper-define-map x 1
- babel-helper-function-name x 2
- babel-helper-replace-supers x 1
- babel-helper-regex x 1
- babel-messages x 15
- babel-helper-get-function-arity x 3
- babel-code-frame x 15
- babel-helper-optimise-call-expression x 1

Recommend running `npm dedupe`

✖ We found some outdated packages:

- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29

Found potential issues on your machine :(
</code></pre></div>