Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
Added sourcemaps to gulp
Browse files Browse the repository at this point in the history
Added source maps to gulp file for the main css file
  • Loading branch information
benbrehaut committed Sep 5, 2017
1 parent eda3cd9 commit 0b1849c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var concat = require('gulp-concat');
var imagemin = require('gulp-imagemin');
var prefix = require('gulp-autoprefixer');
var svgstore = require('gulp-svgstore');
var sourcemaps = require('gulp-sourcemaps');

/**
* @function variables
Expand Down Expand Up @@ -65,13 +66,15 @@ gulp.task('scripts', function () {
*/
gulp.task('styles', function () {
return gulp.src(mainSassFile)
.pipe(sourcemaps.init())
.pipe(sass({
includePaths: ['scss'],
onError: browserSync.notify
}).on('error', sass.logError))
.pipe(prefix(autoprefixerOptions, { cascade: true }))
.pipe(plumber())
.pipe(concat(outputCSSFile)) // output main CSS file without cleanCSS
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest(outputCSSFileLocation))
.pipe(cleanCSS())
.pipe(concat(outputCSSFileCompressed)) // output main CSS file w/ cleanCSS
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"gulp-imagemin": "^3.3.0",
"gulp-plumber": "^1.1.0",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.6.1",
"gulp-svgmin": "^1.2.4",
"gulp-svgstore": "^6.1.0",
"gulp-uglify": "^3.0.0"
Expand Down

0 comments on commit 0b1849c

Please sign in to comment.