9

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?

0

1 Answer 1

15

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.

Sign up to request clarification or add additional context in comments.

1 Comment

From comments in the spec, sounds like sourcesContent was added in February 2013 to match support that already existed in Chrome for self contained source maps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.