-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested Sass always shows line number for parent selector in sourcemaps when using autoprefixer #771
Comments
Autoprefixer is just a PostCSS plugin. All work for CSS transformation and source maps is in PostCSS :). |
I think this issue is related postcss/postcss#926 |
Ah, alright, I didn't know that. Thanks for the info, I'll subscribe to the postcss issue then :) |
I don't think this has to do with postCSS at all as I'm not using postCSS in my build; eg; gulp.task('styles', function() {
return gulp.src('scss/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: [
'last 4 Chrome versions',
'last 4 Firefox versions',
'last 4 Edge versions',
'last 2 Safari versions',
'ie >= 10',
'> 1.49%',
'not ie <= 9'
],
cascade: false
}))
.pipe(sourcemaps.write('../maps'))
.pipe(gulp.dest('./css/'));
}); So it can't have to do with postCSS. |
@cyphix333 there is no way to use Autoprefixer without PostCSS. Autoprefixer is just a PostCSS plugins. So you are PostCSS user even if you use Also please migrate from |
Oh ok thanks, That's good to know and also answers my question I had on SO last year :) |
cross posting from gulp-sourcemaps/gulp-sourcemaps#161 I've been having this issue and the only way I've managed to fix it is to run both autoprefixer and cssNano together. I'd prefer to not minify when local dev because there's a legacy stylesheet with 20k lines in it... but this was the only thing that worked. Maps work perfectly fine in Chrome, a little bit funky in FF (sometimes goes to closing bracket) and breaks in Safari (Goes to parent).
versions
|
I just wish someone would fix this problem so we didn't have to rely on workarounds. |
Use PostCSS based preprocessors, they don't have compatible issue since they use same parser and AST 😏 |
See this issue here:
gulp-sourcemaps/gulp-sourcemaps#161
When using autoprefixer, sourcemaps stop working correctly for nested selectors. They always show the line number of the parent selector. When I remove autoprefixer everything works fine.
The author of gulp-sourcemaps points out this is a problem with autoprefixer, not with the sourcemaps plugin. Could you please look into this?
The text was updated successfully, but these errors were encountered: