title: How to use ES6 import/export with Webpack 4?
body: <p>I'm trying to get a basic ES6 <code>import</code>/<code>export</code> working with Webpack 4, and Webpack can't seem to resolve my module, though per the error message it's looking right at it:</p>
  
  <pre><code>$ make
  ./node_modules/.bin/webpack --mode production src/app.js -o dist/bundle.js
  Hash: 6decf05b399fcbd42b01
  Version: webpack 4.1.1
  Time: 339ms
  Built at: 2018-3-11 14:50:58
   1 asset
   Entrypoint main = bundle.js
      [0] ./src/app.js 41 bytes {0} [built]
  
  ERROR in ./src/app.js
  Module not found: Error: Can't resolve 'hello.js' in '/home/(myhomedir)/code/js/src'
   @ ./src/app.js 1:0-31 2:0-5                                    
  </code></pre>
  
  <p>Here's my setup (<code>node_modules</code>, <code>dist</code> etc. omitted):</p>
  
  <pre><code>$ npm ls --depth=0
  .
  ├── webpack@4.1.1
  └── webpack-cli@2.0.11
  
  $ tree
  .
  ├── Makefile
  └── src
      ├── app.js
      └── hello.js
  </code></pre>
  
  <p>Makefile:</p>
  
  <pre><code>webpack = ./node_modules/.bin/webpack --mode production
  entry = src/app.js
  
  webpack: $(entry)
      $(webpack) $(entry) -o dist/bundle.js
  </code></pre>
  
  <p>src/app.js:</p>
  
  <pre><code>import {hello} from "hello.js";
  hello();
  </code></pre>
  
  <p>src/hello.js:</p>
  
  <pre><code>function hello() {
      alert("yes it's hello");
  }
  export { hello };
  </code></pre>
  
  <p>I've tried many variations on the import path in <code>app.js</code>, but they all get the same result: <code>Can't resolve</code> the module file. What am I missing?</p>