Gulp and Babel: Error: Cannot find module
<p>I have a project that I've set up using <code>gulp</code> and <code>babel</code>. Everything is working fine, except when I create a module and import it once it's converted from ES6 to ES6 it doesn't work. I get an error:</p>

<pre><code>Error: Cannot find module 'hello.js'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
</code></pre>

<p>Here's my <code>gulpfile.babel.js</code>:</p>

<pre><code>import gulp from "gulp";
import babel from "gulp-babel"
import concat from "gulp-concat"

const dirs = {
  src: "src",
  dest: "build"
}

gulp.task("build", () =&gt; {
  return gulp.src(dirs.src + "/**/*.js")
         .pipe(babel())
         .pipe(concat("build.js"))
         .pipe(gulp.dest(dirs.dest))
});

gulp.task("default", ["build"]);
</code></pre>

<p>During build everything is concatenated into one file. Under <code>src/</code> I have:</p>

<ul>
<li>app.js</li>
<li>hellojs</li>
</ul>

<p><strong>app.js</strong></p>

<pre><code>import hello from './hello.js'
console.log(hello());
</code></pre>

<p><strong>hello.js</strong></p>

<pre><code>export default () =&gt; {
    return 'Hey from hello.js';
};
</code></pre>

<p>And I run like so:</p>

<pre><code>npm start
</code></pre>

<p>Which basically calls <code>node ./build/build.js</code>.</p>

<p>I think it's because it's concatenating the ES6 into ES5 and the <code>bundle.js</code> still contains the require for <code>hello.js</code>. It wont find it though because its concatenated. Is that possible?</p>