Skip to content

LIBSASS_SOURCEMAPS only shows "main" file in sources when compression is enabled #60

@Alex-Sichkar

Description

@Alex-Sichkar

Hi, I have a question about the LIBSASS_SOURCEMAPS setting behavior.

When COMPRESS_ENABLED = False, source maps work as expected — Chrome DevTools shows all SCSS source files in the map (including partials like _variables.scss, _mixins.scss, etc.).

But when COMPRESS_ENABLED = True, the generated source map only shows main.scss in the "sources" list. However, the generated /* line X, path/to/file.scss */ comments are still correct and refer to the actual source files.

Example structure:

static/
  src/
    scss/
      main.scss        ← entry point
      _variables.scss
      _mixins.scss
      ...

Sample SCSS in main.scss:

@import "variables";
@import "mixins";

body {
  color: $text-color;
}

Expected:
Source map to include all source files.

Actual:
Only main.scss is listed in "sources", though comments refer to the correct files.

Is this by design when using django-compressor with django-libsass? Or is there a way to include all source contents in maps even when compression is enabled?

Thanks!

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