-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
64 lines (58 loc) · 1.48 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
52
53
54
55
56
57
58
59
60
61
62
63
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var runSequence = require('run-sequence');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
AUTOPREFIXER_BROWSERS = [
'ie >= 10',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 7',
'opera >= 23',
'ios >= 7',
'android >= 4.4',
'bb >= 10'
];
var report_error = function(error) {
$.notify({
title: 'An error occured with a Gulp task',
message: 'Check you terminal for more informations'
}).write(error);
};
gulp.task('scss', function () {
return gulp.src('src/scss/flex.scss')
.pipe($.sourcemaps.init())
.pipe($.sass({
precision: 6,
outputStyle: 'expanded',
sourceComments: true,
indentWidth: 4,
}))
.on('error', report_error)
.pipe($.autoprefixer({
browsers: AUTOPREFIXER_BROWSERS
}))
.pipe($.sourcemaps.write())
.pipe(gulp.dest('dest/css'))
.pipe($.size({title: 'css'}))
.pipe($.cssmin())
.pipe($.rename({ suffix: '.min' }))
.pipe(gulp.dest('dest/css'));
});
gulp.task('scss_test', function () {
return gulp.src('test/src/style.scss')
.pipe($.sourcemaps.init())
.pipe($.sass({
precision: 6,
outputStyle: 'expanded',
sourceComments: true,
indentWidth: 4,
}))
.on('error', report_error)
.pipe($.autoprefixer({
browsers: AUTOPREFIXER_BROWSERS
}))
.pipe($.sourcemaps.write())
.pipe(gulp.dest('test/dest'));
});