-
Notifications
You must be signed in to change notification settings - Fork 20
Source maps #15
Comments
Started looking to this today. It's not particularly trivial, but of course certainly doable. For input that doesn't have a map, AFAICT we'll still need to map each individual output line explicitly to its input. I don't quite see a shorthand way of allowing subsequent output lines to just keep matching up with input (although perhaps just a semicolon per line For input that has already been processed (i.e. already having a map file of its own), there is a source map "index" format. This would primarily be detected via the Potential gotchasTo be honest, the source map proposal still has a very inelegant feel to it. Or put more nicely, it's a very practical way to start dealing with the problem from the browser's view, with very little to facilitate implementation of the generator's workflow/tooling IMO.
References
|
Hah, after all that I think I just realized a much much simpler way to deal with this in practice!
I.e. have |
Dang it, of course I can't just skip update: so I guess I could leave /blank/ lines in place of the stripped import statements…hmmm… |
Oy, this is ugly but, it works! Backstory: this assumes source directory
Voilà! Every time I modify any relevant source file or even make a new To deal with the The lovely import-truncating regex is a ported version of smash/lib/smash/emit-imports.js Line 26 in d5efeea
Note that make will remove the intermediary files automatically, but the directories just get left as litter…neither one is particularly ideal (could make the files .SECONDARY but…enough on this for the day). |
I'm finding a couple of caveats:
|
Perhaps this could be best solved by splitting into three separate stages:
Then I could use the same Makefile trick for an app-specific custom D3 build as well. E.g.
|
Here's a "behind the scenes" look at how browserify got source map support, some interesting tips/strategies: http://thlorenz.com/blog/browserify-sourcemaps |
SMASH transmorgrifies an input and outputs JavaScript. Anything that transmorgrifies an input and outputs JavaScript should generate a source map. Therefore, SMASH should generate a source map. ∎
The text was updated successfully, but these errors were encountered: