As Chrome supports EcmaScript 6 modules now (Medium article), I thought I could develop a demo app using the export
and import
syntax. However, this only works when uploading my code to a server - which is quite annoying when developing. Other developers have faced similar problems and recommend using Chrome with --disable-web-security
(Disable same origin policy in Chrome) or --allow-file-access-from-files
(How to launch html using Chrome at “--allow-file-access-from-files” mode?). However, I now get the error
Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
And I can't seem to find a way to turn off Strict MIME type checking in Chrome (my version is 64.0.3282.140).
So, this is my question: How can I develop ES6 modules locally with Chrome (this must be possible, surely)?