hatch-sh / hatch

🐣 Easy deployment of static websites to Amazon Web Services
https://hatch.sh
5 stars 0 forks source link

Woff2 mime-type support #50

Closed Ragnar-H closed 7 years ago

Ragnar-H commented 7 years ago

Context

I was trying 🐣 out on a pet project which has Font Awesome as a dependency. MimeTypes doesn't like woff2 however, resulting in the following error

➜  flash-cards-react git:(master) ✗ hatch website deploy
Hatching...
Unknown content-type for ./dist/node_modules/font-awesome/fonts/fontawesome-webfont.woff2

Fix

Add the mime-type in the same manner as for .map here

def _upload_artifacts(self, bucket):
        mimetypes.add_type('application/json', '.map')
        mimetypes.add_type('application/woff2', '.woff2')

Thoughts

I suppose this issue is more about if Hatch should support use cases like this, and where to draw the line.

If so, I'll be happy to submit a PR with the 1 line of code 💪

mads-hartmann commented 7 years ago

@Ragnar-H Thanks a lot for giving it a go. Adding support for .woff2 sounds like a good idea, please go ahead and submit a PR :)