Skip to content

Commit

Permalink
Serve source map files as application/json
Browse files Browse the repository at this point in the history
Developer tools don't actually care what `Content-Type` source map
files are served with. However, mapping their file extension (`.map`)
to the `application/json` media type, ensures that they will be served
compressed and their character encoding will be UTF-8.

See also:

* Source Map Revision 3 Proposal
  https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/

* Introduction to JavaScript Source Maps
  http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/

* How CSS source maps work
  https://developers.google.com/chrome-developer-tools/docs/css-preprocessors#toc-how-css-source-maps-work

* What MIME-type should I use for source map files?
  http://stackoverflow.com/a/19912684
  • Loading branch information
alrra committed Dec 30, 2013
1 parent 994cd1f commit 7d114e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .htaccess
Expand Up @@ -124,11 +124,13 @@ Options -MultiViews
AddType audio/mp4 m4a f4a f4b
AddType audio/ogg oga ogg opus

# Data interchange
AddType application/json json map

# JavaScript
# Normalize to standard type (it's sniffed in IE anyways):
# http://tools.ietf.org/html/rfc4329#section-7.2
AddType application/javascript js
AddType application/json json

# Video
AddType video/mp4 f4v f4p m4v mp4
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
### HEAD

* Serve source map files with the `application/json` Content-Type.
* Make `RewriteCond`s for `example.com → www.example.com` more permissive
([#11](https://github.com/h5bp/server-configs-apache/issues/11)).
* Add configs for Ogg Opus audio files
Expand Down

0 comments on commit 7d114e8

Please sign in to comment.