jstransformer
jstransformer copied to clipboard
What about source maps?
There is something intended to support sourcemaps in JSTransformer?
They aren't officially supported as far as I'm aware. I suppose nothing prevents a JSTransformer from outputting an inline sourcemap with the result.
@RyanZim make sense, thanks.
Which SourceMaps are you looking for? For which engine? Transformers can compile to an object with body, dependencies. It could return any additional options, perhaps.
@RobLoach True, hadn't thought of that.
Interested in this with webpack, since it saves other things directly to the filesystem too.
I would really like to get this implemented.
@jstransformers/core should we output the source map in a sourceMap
property in the output object?
var coffee = require('jstransformer')(require('jstransformer-coffee'))
coffee.render('n = 42', {bare: true}).sourceMap
//=> sourcemap...
If this looks good, I may get to beginning an implementation this weekend
I think the convention is .map
but I don't see a reason not to.
I'm for .map
too. The only one thing needed (and that is our job) is that we should add convert-source-map
package and just extract the inline sourcemap if exists.
This part of the start-browserify/index.js#L43-L46 that I built today is just enough here too.
edit: reminder when is implemented: update the rollup transformer