Do source maps include the source text?


When I generate a source map from minified js back to source files, does the map include the text of the source files, or do I need to host them separately?

The HTML5 Rocks description mentions the sources key that lists the names of source files, and explains how mappings maps minified line and column numbers to original line and column numbers, but suggests "You'll also need to upload your original files so the dev tools can reference and display them when necessary".

Browserify's debug option generates inline source maps that show original files in dev tools without hosting the source files separately.

Does the current source map spec support both?

Source maps can optionally include the original source.

From the spec, sourcesContent is "An optional list of source content, useful when the “source” can’t be hosted.

source-map (the node module powering browserify source maps) supports sourcesContent. Coffeeify populates sourcesContent by default, inlining source text.