Must a sourcemap have a .map extension?

后端 未结 2 984
情歌与酒
情歌与酒 2021-01-21 04:51

If I create a source map, must I give it a .map extension, or could I call it .foo, as long as it has the correct headers?

If someone could point to documentation on thi

2条回答
  •  萌比男神i
    2021-01-21 05:10

    It can have any extension. In the compressed/minified/original file you put a sourceMappingUrl comment or SourceMap http header that tells the interpreter where to find the source map.

    There's no true formal spec for source maps but this is the informal one: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit

提交回复
热议问题