Skip to content

Commit 31a299b

Browse files
committed
fix(update): fixed compiling SASS with source maps after updating node-sass and Autoprefixer to latest version
1 parent 616f046 commit 31a299b

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

gulpfile.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,13 @@ var fnSass = function (path) {
2727
return gulp.src(path)
2828
.on('data', processWinPath)
2929
.pipe(plugins.plumber())
30-
.pipe(plugins.sass({
31-
sourceComments: 'map'
32-
}))
30+
.pipe(plugins.sourcemaps.init())
31+
.pipe(plugins.sass())
32+
.pipe(plugins.sourcemaps.write())
3333
.on('error', function (err) {
3434
console.log(err.message);
3535
// process.exit(1);
3636
})
37-
.pipe(plugins.autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4', {
38-
map: true,
39-
from: pkg.name + '-' + pkg.version + '.css',
40-
to: pkg.name + '-' + pkg.version + '.css'
41-
}))
4237
.pipe(plugins.size({ showFiles: true, title: '[CSS]' }))
4338
.pipe(gulp.dest(config.build + '/assets'))
4439
.on('end', function () {
@@ -66,6 +61,9 @@ gulp.task('styles', ['styles:sass', 'vendor:css'], function () {
6661
var arr = (config.vendor_files.css).concat(config.build + '/assets/' + pkg.name + '-' + pkg.version + '.css');
6762
return gulp.src(arr)
6863
.pipe(plugins.concat(pkg.name + '-' + pkg.version + '.css'))
64+
.pipe(plugins.autoprefixer({
65+
browsers: ['last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4']
66+
}))
6967
.pipe(plugins.minifyCss({ keepSpecialComments: 0 }))
7068
.pipe(plugins.rename({ suffix: '.min' }))
7169
.pipe(plugins.size({ showFiles: true, title: '[CSS]' }))

0 commit comments

Comments
 (0)