Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better source_map support #22

Merged
merged 3 commits into from
May 23, 2013
Merged

Better source_map support #22

merged 3 commits into from
May 23, 2013

Conversation

rogueg
Copy link
Contributor

@rogueg rogueg commented May 22, 2013

These commits try to get source maps working correctly.

I believe the map generated before wasn't valid, and lacked a bunch of the attributes the browser needs to correctly show the original source.

grant added 3 commits May 21, 2013 19:06
When CoffeeScript.compile is normally called, the result is a string containing
the compiled js.  When sourceMap is set to true though, the result is a hash
with keys ['js', 'sourceMap', 'v3SourceMap'].

Before this change, we'd write that entire hash into the .map file, and I'm
somewhat sure that isn't a valid sourceMap.
The coffeescript compiler accepts various file and path options to help
the browser find the original source files that the map refers to.

sourceFiles - name of the original sources.

sourceRoot - Root url the browser prepends to all sourceFiles. It's useful to
override this if you want to change where/how these files are served, like adding
authentication.

generatedFile - I'm actually not sure why this is necessary, since the generated
file itself should refer to the map. I added in an effort to closely match the
output of the coffee binary.
The comment tells the browser where to download the source map. It's also
possible to inform the browser using an HTTP header, but the comment is
better by default, because things will work right out of the box.
netzpirat added a commit that referenced this pull request May 23, 2013
Better source_map support
@netzpirat netzpirat merged commit 50d957f into netzpirat:master May 23, 2013
@netzpirat
Copy link
Owner

Thanks a lot. Version 1.3.1 is released.

@netzpirat netzpirat mentioned this pull request Jun 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants