Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Using with grunt-sass, sourcemaps drill-down into mixins too far. #115

Open
Jaace opened this issue Sep 7, 2017 · 0 comments
Open

Using with grunt-sass, sourcemaps drill-down into mixins too far. #115

Jaace opened this issue Sep 7, 2017 · 0 comments

Comments

@Jaace
Copy link

Jaace commented Sep 7, 2017

To elaborate, my setup is, roughly:

  • Compile .scss (from a global file that uses @import) into a .css file, specifying source maps.
  • Take the compiled .css file, generated from grunt-sass and run through postcss for auto-prefixing and minification using cssnano.

Now, if I leave postcss out of the equation, my source maps with grunt-sass look good. However, when I run it through postcss, my source maps look mostly ok, except where I'm using an @include mixin-name-here() as the first rule of a selector. In these cases, my post-css generated source map is drilling down all the way to the mixin name, which is not what I want.

E.g.:
.some-element { @include a-cool-mixin(); other: rules; }
This shows up as the mixin source in the source-map, so it would be like _cool-mixin.scss line 4 where that mixin is defined, instead of _layout.scss line 50, where the mixin was called.

Is there a way to stop postcss from drilling down into the mixin for the source map? I've tried many options in the setup, but cannot get this to work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant