title: ES6 Modules/Imports in Apache Cordova Hybrid App Throw MIME Type Error
body: <p>I'm trying to use ES6 Modules in a hybrid mobile app built using Apache Cordova. Unfortunately, Cordova seems to be serving the module without a MIME type, which is throwing an error in the WebView (In both Chrome 63 and 64 beta).</p>
  <p>Specifically, the deployed app (using <a href="https://developers.google.com/web/tools/chrome-devtools/remote-debugging/" rel="noreferrer">chrome remote debugger</a>) throws the following error:</p>
  <pre class="lang-none prettyprint-override"><code>Failed to load module script: The server responded with a non-JavaScript MIME type of &quot;&quot;. Strict MIME type checking is enforced for module scripts per HTML spec.
  </code></pre>
  <p>I'm using a bog standard ES6 import, which is now supported in the targeted version of chrome.</p>
  <pre><code>&lt;!--index.html--&gt;
  &lt;script type=&quot;module&quot;&gt;
      import App from &quot;./app.js&quot;
      import config from &quot;./config.js&quot;
      window.app = new App(config)
  &lt;/script&gt;
  </code></pre>
  <p>Everything works properly when the prebuild assets are served over a webserver rather than deployed through Cordova. Transpiling through Babel might be an option, but it seems like a huge headache and I'd rather not go down that path until I know there's no better option.</p>
  <p>Any advice?</p>