-
Notifications
You must be signed in to change notification settings - Fork 464
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
Append to a provided source map #668
Comments
I have ported some perl code to c++ in a side project to get something going. |
Are we currently using this library in libsass? Also, be aware that I know basically nothing about C++ 😄 (even though I did write the initial
|
You need to be more specific what you mean by "add" or "append"!? This is not really possible with source-maps!?? But I'm pretty sure what you are looking for is something I already implemented for webmerge (I called it | You (as the pre-processor) have two input files which you combine to one output file. You create a valid source-map for this operation. Now you give your output to libsass, which will generate the final css and another source-map. the libsass source-map will only point back to the "intermediate" input file (the one the pre-processor generated), but in reality it should point back to the two original input files, right!? This would be exactly the use case for my "remap" function. This is really just an operation on two source-map (it just "connects" the pointers from source-map b to a). The custom importers already have an argument to pass a srcmap for exactly this reason, but so far we do not have anything implemented (it is just already defined on the API). As you may see, I'm currenty developing a C++ library to abtract most of this stuff for libsass. Once this is in place it should be much easier to work with source-maps from a coding stand-point. |
Okay great, thanks. Your guess is exactly right, so it looks like If I understand correctly:
It looks to me that the natural place for this to live would be libsass itself. Ideally I'd like to be able to provide a source map to libsass and have it perform this remap on the source map that it produces. Do you agree? How would this fit into the roadmap? What can I do to help? |
That's exactly what my intensions are. It's just much easier to develop this as a standalone library first, and I can re-use it for webmerge to replace my slow perl implementation. For |
Awesome, thanks for that. Totally understand that you've got higher priorities, but definitely looking forward to seeing this when it arrives. |
I created a collective ticket to keep track this and other "non-urgent" feature requests, in order to keep the issue tracker a bit more clean for the more 1st aid issues. I would like to encourage everybody interested in this particular feature to add their comments into this closed issue anyway. Thanks for your understanding and your contribution! |
Is fixing the Source Map feature in any milestone? I know you might have other priorities, but I'd really love to see it working. This would help fine tune development quite a lot for many teams. Thank you |
I think this is a close one, correct me if i'm wrong. |
It's possible to have source files that have already undergone some preprocessing (this is the common case in broccoli-sass) before they're handed to libsass. In this case it's not possible for libsass to maintain the mapping all the way back to the original source files.
The solution to this is add the ability to provide a source map to libsass which contains the previous mappings, and then libsass would append to this source map with its own transformations.
append_source_map
?The text was updated successfully, but these errors were encountered: