-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
68 lines (61 loc) · 1.82 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
67
68
'use strict';
const gulp = require('gulp');
const csso = require('gulp-csso');
const cssimport = require('gulp-cssimport');
// var csscomb = require('gulp-csscomb');
const rename = require('gulp-rename');
const stylelint = require('gulp-stylelint');
// Prepare for distribution
gulp.task('release', function () {
if (process.argv[3] === '--light') {
return gulp
.src('grave-light.css')
.pipe(cssimport({matchPattern: '*.css'}))
.pipe(csso())
.pipe(rename('grave-light.min.css'))
.pipe(gulp.dest('dist'));
}
if (process.argv[3] === '--dark') {
return gulp
.src('grave-dark.css')
.pipe(cssimport({matchPattern: '*.css'}))
.pipe(csso())
.pipe(rename('grave-dark.min.css'))
.pipe(gulp.dest('dist'));
}
return gulp
.src('grave.css')
.pipe(cssimport({matchPattern: '*.css'}))
.pipe(csso())
.pipe(rename('grave.min.css'))
.pipe(gulp.dest('dist'));
});
// Based of .csscomb.json file refactor the *.css files by sorting it properties alphabeticaly
// gulp.task('refactor', function () {
// return gulp
// .src(['src/*.css', 'grave.css'])
// .pipe(csscomb())
// .pipe(gulp.dest('src'));
// });
//Based of .stylrc.json file check it's codestyle
gulp.task('stylelint', function () {
var reporters = {
reporters: [{
formatter: 'string',
console: true
}]
};
return gulp
.src([
'src/*.css',
'src/form/*.css',
'src/form/input/*.css',
'src/structure/*.css',
'src/text/*.css',
'src/vendor/*.css',
'grave.css',
'grave-dark.css',
'grave-light.css'
])
.pipe(stylelint(reporters));
});