-
Notifications
You must be signed in to change notification settings - Fork 84
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
CoffeeScript source map support. #82
Conversation
If you have a file `foo.coffee` or `foo.js.coffee`, when you load `foo.js`, the `X-SourceMap` header is added to the response with value `foo.js.map`. Inside this source map is a reference to `foo.coffee`. When the browser makes a request to `foo.coffee` it will return the uncompiled CoffeeScript source. This allows debugging CoffeeScript source in a browser and also works with IntelliJ Remote Javascript debugger too. Includes tests. See Issue js-kyle#39.
The source map should be generated when the Coffeescript is compiled. This is easy, its just a Coffeescript compiler option. The question I have is where to save the source map? Should I create a |
…cessedAsset. An additional parameter was added to the `Context#evaluate` callback called `extra` which allows us to pass back the original source (CoffeeScript code) and the source map from the engine.
I've changed how this works. Source maps are now generated during compilation and cached in a ProcessedAsset which should be much faster than before. |
TODO: Need to add an option to |
Impressive. 👏 I tend to merge it, but with small improvements :D Thanks. |
Can the community take on these improvements? :) We really require this functionality. |
Closed pull-request as outdated. But ticket about sourcemaps is still open and has reference here. |
@vjpr , coffescript sourcemaps are now ok on sourcemap branch. Enjoy! 1.0.0 will be released soon. |
If you have a file
foo.coffee
orfoo.js.coffee
, when you loadfoo.js
, theX-SourceMap
header is added to the response with valuefoo.js.map
.Inside this source map is a reference to
foo.coffee
. When the browser makes a request tofoo.coffee
it will return the uncompiled CoffeeScript source.This allows debugging CoffeeScript source in a browser and also works with IntelliJ Remote Javascript debugger too.
Includes tests.
See Issue #39.