You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I posted a question on SO, but then thought I might also ask here.
Does estraverse support making a source map? Something like estraverse.replace(ast, transform, sourceMap) would be awesome. Maybe in the returned AST object the root node can have a sourceMap property? Or something along the lines of being able to supply a source map for the original AST in order to get the resulting source map. If no sourcemap is provided, then it would just return a sourcemap as if this is the first transform on the given code.
Would something like that be doable? What are the limitations? For example, I know the AST doesn't contain info about semi colons or the number and ordering of whitespace characters, so it may be difficult to map that.
Is there any existing recommended way to handle source maps with esprima+estraverse?
The text was updated successfully, but these errors were encountered:
I posted a question on SO, but then thought I might also ask here.
Does estraverse support making a source map? Something like
estraverse.replace(ast, transform, sourceMap)
would be awesome. Maybe in the returned AST object the root node can have asourceMap
property? Or something along the lines of being able to supply a source map for the original AST in order to get the resulting source map. If no sourcemap is provided, then it would just return a sourcemap as if this is the first transform on the given code.Would something like that be doable? What are the limitations? For example, I know the AST doesn't contain info about semi colons or the number and ordering of whitespace characters, so it may be difficult to map that.
Is there any existing recommended way to handle source maps with esprima+estraverse?
The text was updated successfully, but these errors were encountered: