johnpapa / johnpapa/lite-server
Serve ES module mimetypes for mjs
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 262
- PR merge metrics
- No merged PRs in 30d
Description
[Chrome Canary now supports ES module loading](https://medium.com/dev-channel/es6-modules-in-chrome-canary-m60-ba588dfb8ab7). However, if the module is served with [an incorrect JS mimetype](https://jakearchibald.com/2017/es-modules-in-browsers/#mime-types) or does not have a `.js` extension (i.e. `.mjs`), the browser will load the module _but will ignore it_ and halt the application.
At the moment, lite-server serves `.mjs` as `Content-Type:application/octet-stream`.
### Environment
- `lite-server` version: 2.3.0
- `nodejs` version: 8.0.0
- `npm` version: 5.0.0
- OS type/version: MacOS Sierra
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.