I'm trying to get the line numbers of my SASS file in to my compiled CSS file. According to docs I must set debug_info
to true, but is not working at all.
// Styles
gulp.task('styles', function() {
return gulp.src('src/sass/**/*.scss')
.pipe(sass({errLogToConsole: true}))
.pipe(sass({ style: 'expanded', debug_info: true }))
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(gulp.dest('build/dev/css'))
.pipe(minifyCSS())
.pipe(gulp.dest('build/production/css'));
});
Anyone know if this is possible using gulp-sass plugin?
It is possible for gulp-sass
, I would say that what SteveLacy points out is the solution you where looking for.
In your code it would look like this:
// Styles
gulp.task('styles', function() {
return gulp.src('src/sass/**/*.scss')
.pipe(sass({errLogToConsole: true}))
.pipe(sass({
style: 'expanded',
sourceComments: 'normal'
}))
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(gulp.dest('build/dev/css'))
//.pipe(minifyCSS())
.pipe(gulp.dest('build/production/css'));
});
Note that gulp-minify-css
will strip any comments added by gulp-sass
, so I commented it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With