-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·66 lines (60 loc) · 1.5 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
64
65
66
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
rename = require('gulp-rename');
var sass = require('gulp-sass'),
combineMq = require('gulp-combine-mq'),
csso = require('gulp-csso'),
cleanCss = require('gulp-clean-css'),
autoprefixer = require('gulp-autoprefixer');
var postcss = require('gulp-postcss'),
uncss = require('uncss').postcssPlugin,
importCss = require('postcss-import'),
reporter = require('postcss-reporter'),
immutableCss = require('immutable-css');
gulp.task('immutable', function () {
var processors = [
importCss,
immutableCss({
strict: true,
// verbose: true,
ignoredClasses: ['.cf', '.input-reset', '.link']
}),
reporter({
clearMessages: true,
throwError: false,
})
]
gulp.src('dist/tachyons.css')
.pipe(postcss(processors))
// .pipe(gulp.dest('dist/immutable'))
})
gulp.task('styles', function(){
gulp.src(['src/**/*.scss'])
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
this.emit('end');
}}))
.pipe(sass({
precision: 4,
}))
.pipe(autoprefixer({
browsers: ['>= 0%'],
}))
.pipe(gulp.dest('dist/'))
.pipe(combineMq({
beautify: true,
}))
.pipe(cleanCss({
}))
.pipe(csso({
debug: true,
}))
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('dist/min/'))
});
gulp.task('default', function(){
gulp.watch("src/styles/**/*.scss", ['styles']);
});