Switch to a local mime-type lookup table#148
Switch to a local mime-type lookup table#148bengotow wants to merge 2 commits intoelectron-userland:masterfrom
Conversation
- Fixes detection of CJSX - Fixes detection of TSX - Update require-hook to support multiple extensions per mimetype, fixes support for `.es6` JS files and `.litcoffee` files read via require.
2d18567 to
877001d
Compare
|
So, the reason we use @paulcbetts/mime-types is not to add mime-types, but to remove them. The shipped mime-db is huge and takes up like megabytes of memory, and 99%+ of the MIME types are for non-web content. @paulcbetts/mime-db is stripped to only MIME types that browsers are interested in |
|
Hey! Sorry for the delay - I think the issue is that In this PR |
This PR replaces
@paulbetts/mime-typeswith a local lookup table of mime types to file extensions. This is a bit less sophisticated than the previous approach, but allows electron-compile to be more flexible and removes the need forrig-mime-types, which took me a while to find when trying to contribute to the project.It also fixes a few issues:
.es6JS files and.litcoffeefiles read via require.Resolves my general confusion in #145 :-)