Pergunta

Currently I am serving sourceMappingURL files with following contenttype:

Content-type:text/javascript; charset=utf-8

Is this correct? It works, but I don't know, if it is correct. What other headers should I send along with it?

Foi útil?

Solução

Javascript sourcemaps should be served with Conent-type: application/json since the file is single JSON object.

To supply source map over HTTP, use SourceMap: <url> header.

Or you can link source map in file comment for both, javascript (//# sourceMappingURL=<url>) and css (/*# sourceMappingURL=<url> */).

Note: X-SourceMap <url> is deprecated.

Source: Source Map Revision 3 Proposal

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top