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

Added support for generating source maps #25

Closed
wants to merge 3 commits into from
Closed

Added support for generating source maps #25

wants to merge 3 commits into from

Conversation

dhm116
Copy link

@dhm116 dhm116 commented Mar 7, 2013

I tried to maintain a similar coding style for the changes, but let me know if there's anything you'd like changed!

@filmic
Copy link

filmic commented Mar 11, 2013

Your solution is not working because the generated JS file is missing "sourceMappingURL" in a comment line (eg. //@ sourceMappingURL=Footer.map ). Without this line browser will not load a map file.

See how CoffeeScript compiler does it here: https://github.com/jashkenas/coffee-script/blob/master/lib/coffee-script/command.js#L410

@dhm116
Copy link
Author

dhm116 commented Mar 11, 2013

Due to the limitations of the current implementation of source maps within coffeescript, the coffee file must be located in the same directory as the resulting js and map files.

One solution would be to accept an additional parameter on the command line for specifiying the sourceRoot property to be used in the resulting map file(s). However, because the v3SourceMap property returned from the coffeescript compiler is currently a json string, it would obviously require parsing - it may be better to submit a request to be able to modify this parameter either by passing an option to the compiler, or simply being able to modify the SourceMap object instance directly.

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.

None yet

2 participants