django-libsass icon indicating copy to clipboard operation
django-libsass copied to clipboard

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

Open Alex-Sichkar opened this issue 5 months ago • 0 comments

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!

Alex-Sichkar avatar May 29 '25 11:05 Alex-Sichkar