-
Notifications
You must be signed in to change notification settings - Fork 39
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
Source maps #11
Comments
@mathiasbynens: where have you been? estools/escodegen#50 All that esmangle has to do is preserve the |
Whoa, that's exciting. Nice work @michaelficarra |
@michaelficarra Nice! |
/cc all This is a good place to discuss about source-map generation, thanks @mathiasbynens.
Yes. Thanks to @michaelficarra, now escodegen can generate source maps. |
I've committed initial location copy code. |
Full source map support: 97681bf |
By passing original location information to generated node, we can get source-map from minified result to original script. |
@Constellation can you document this in the readme? Specifically the cmd line option? |
@paulirish: What do you mean? Source information is now preserved (unconditionally) through transformations. The difference now is that, when you use escodegen to render the resulting AST as JS, the source information hasn't been lost. So it "just works" when you generate source maps through escodegen. |
I guess I don't understand the workflow. I'm thinking about using esmangle I'm looking at the source-map option: How are you thinking about escodegen's role here? On Tue, Nov 27, 2012 at 8:13 PM, Michael Ficarra
|
I describe design of tools, Esprima, Escodegen and Esmangle. Esprima: input JS code output AST Escodegen's role is generating JavaScript code or SourceMap from AST. loc: {
start: { line: 1, column: 0 },
end: { line: 1, column: 4 }
} When sourceMap option is specified to Escodegen, Escodegen generate SourceMap from above location information attached to AST. And Esmangle preserves this location information through transformation. So if location information is attached to input AST, optimized AST generated by Esmangle also has location information to original source code.
|
@paulirish Just in case you were still wondering here's an example of how to generate sourcemaps from start to finish using esprima, esmangle, and escodegen. Only part not included is adding the http://jsbin.com/omakoh/3/edit Note: The |
Nice! thanks. On Mon, Jul 1, 2013 at 3:15 PM, Pat Cavit notifications@github.com wrote:
|
Would be cool if Esmangle could generate Source Maps for minified files. More info here: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
Is this something that could be considered?
/cc @paulirish
The text was updated successfully, but these errors were encountered: