Skip to content

return relative paths in result.map.sources - not absolute file:// URL #1185

@milahu

Description

@milahu

dart-sass always returns absolute file URLs like file:///absolute/path/to/src/input.css
in the sources array of result.map
also when i enter relative filepaths like src/input.css

is there a way to get relative file paths in result.map.sources?

im looking for the equivalent of options.source_map_file_urls in libsass

// libsass/src/source_map.cpp

if (ctx.c_options.source_map_file_urls) {
  source = File::rel2abs(source);
  // check for windows abs path
  if (source[0] == '/') {
    // ends up with three slashes
    source = "file://" + source;
  } else {
    // needs an additional slash
    source = "file:///" + source;
  }
}

but i had no luck grepping through dart-sass sources

related to sass/node-sass#3057

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