-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
51 lines (44 loc) · 1.38 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
minify = require('gulp-minify-css'),
plumber = require('gulp-plumber'),
sourcemaps = require('gulp-sourcemaps'),
sass = require('gulp-sass'),
globCss = require('gulp-css-globbing'),
combineMq = require('gulp-combine-mq'),
gulpif = require('gulp-if'),
watch = require('gulp-watch'),
gutil = require('gulp-util');
/* ***** Gulp Tasks ***** */
/***
---------------------------------------------------------
// Compile CSS, apply prefixer and sourcemaps if set to dev
--------------------------------------------------------- */
gulp.task('scss', function() {
gutil.log(gutil.colors.bgGreen(' ..::: SCSS TASKS :::... '));
return gulp.src('./app/sass/*.scss')
.pipe(globCss({
extensions: ['.css', '.scss'],
autoReplaceBlock: {
onOff: false,
globBlockBegin: 'cssGlobbingBegin',
globBlockEnd: 'cssGlobbingEnd',
globBlockContents: '../**/*.scss'
}
}))
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: true
}))
.pipe(combineMq({ beautify: false }))
.pipe(sourcemaps.write())
// .pipe(minify())
.pipe(gulp.dest('./app/css'));
});
gulp.task('watch', ['scss'], function() {
// gulp.watch('gulpfile.js');
gulp.watch('./app/sass/**', ['scss']);
});