Skip to content

Instantly share code, notes, and snippets.

@heyjohnmurray
Created October 20, 2015 16:02
Show Gist options
  • Save heyjohnmurray/7224eaef40441aab70e8 to your computer and use it in GitHub Desktop.
Save heyjohnmurray/7224eaef40441aab70e8 to your computer and use it in GitHub Desktop.
gulp sourcemap implementation
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('sass', function() {
return gulp.src(paths.styles.src + 'partials/*.scss')
.pipe(sourcemaps.init()) // all your piping needs to fit between the sourcemaps.init() and sourcemaps.write()
.pipe(concat('main.css'))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest(paths.styles.dest));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment