Skip to content

Support for Source Maps #3

@cuchac

Description

@cuchac

I'm going to implement sourceMaps to sassphp. Is there any previous work related to this? I will also work on Sacy parts, so if you are connected with that project, is there any previous work on this?

Reply from @pilif:

I wrote 99% of sacy, so yeah. I'm familiar with that and I also was looking into source maps and let me tell you: There are challenges ahead:

  • Due to the way how sacy currently works, it really wants to feed the to-be-transformed content to the processor as a big string. When using libsass, this would be done using Sass::compile() and when using the ruby sassc, this is done using stdin. At least in the case of sassc, you can't have source maps when using stdin.
  • This also means that at the time when you run the sass compilation, the information what source file the data came from is not available any more, especially when you use sacy with the merge_tags feature (which you will want to use if you want to have globally available mixins). As such, you won't get any meaningful mapping to the original file.

If you have ideas on how to work around these issues, I'd be excited to have a look at an eventual Pull Request, but all approaches I tried so far were less than optimal in their outcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions