title: Bootstrap 4, Popper.JS, and WebPack -- "import and export may appear only with sourceType: module"
body: <p>I had a project working perfectly with <code>bootstrap@4.0.0-alpha6</code>. I just tried upgrading this project to <code>bootstrap@4.0.0-beta</code> and noticed the new dependency on Popper.js instead of Tether.</p>
  
  <p>I updated my package.json to include <code>popper.js@^1.11.0</code> and updated my code from:</p>
  
  <pre><code>window.Tether = require("tether");
  require("bootstrap");
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>window.Popper = require("popper.js");
  require("bootstrap");
  </code></pre>
  
  <p>Now I'm getting the following error:</p>
  
  <pre><code>./~/popper.js/dist/esm/popper.js
  Module build failed: SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (2429:0)
      at Parser.pp$4.raise (/project/node_modules/acorn/dist/acorn.js:2610:13)
      at Parser.pp$1.parseStatement (/project/node_modules/acorn/dist/acorn.js:782:16)
      at Parser.pp$1.parseTopLevel (/project/node_modules/acorn/dist/acorn.js:690:23)
      at Parser.parse (/project/node_modules/acorn/dist/acorn.js:543:15)
      at parse (/project/node_modules/acorn/dist/acorn.js:3670:37)
      at module.exports (/project/node_modules/falafel/index.js:22:15)
      at /project/node_modules/static-module/index.js:30:13
      at ConcatStream.&lt;anonymous&gt; (/project/node_modules/concat-stream/index.js:36:43)
      at emitNone (events.js:91:20)
      at ConcatStream.emit (events.js:185:7)
   @ ./resources/assets/js/common/bootstrap.js 12:16-36
   @ ./resources/assets/js/website/app.js
  </code></pre>
  
  <p>I'm not super familiar with or good at using WebPack. It was forced upon me by Laravel 5.4, so I've just been floundering up until this point. My <code>webpack.config.js</code> file looks like so:</p>
  
  <pre><code>module.exports = {
    devtool: "source-map",
    module: {
      loaders: [
        {
          test: /\.js/,
          loader: "transform?brfs"
        }
      ]
    }
  }
  </code></pre>