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.
To elaborate, my setup is, roughly:
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.