forked from carlobernardini/nice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
57 lines (54 loc) · 1.64 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
'use strict';
// Utilities
var gulp = require('gulp'),
sass = require('gulp-sass'),
rename = require('gulp-rename'),
stylelint = require('gulp-stylelint'),
autoprefixer = require('gulp-autoprefixer');
gulp.task('fonts', function(){
return gulp.src('./src/fonts/**/*.{eot,svg,ttf,otf,woff,woff2}')
.pipe(gulp.dest('./dist/fonts'));
});
gulp.task('lint', function(){
return gulp.src('./src/**/*.scss')
.pipe(stylelint({
failAfterError: true,
syntax: "scss",
debug: false,
reporters: [{
formatter: "string",
console: true
}]
}));
});
gulp.task('compile', function(){
return gulp.src('./src/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(rename('nice.css'))
.pipe(autoprefixer())
.pipe(gulp.dest('./dist'));
});
gulp.task('compile-min', function(){
return gulp.src('./src/**/*.scss')
.pipe(sass({
outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(rename('nice.min.css'))
.pipe(autoprefixer())
.pipe(gulp.dest('./dist'));
});
gulp.task('docs', function(){
return gulp.src('./docs/**/*.scss')
.pipe(sass({
outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(rename('docs.min.css'))
.pipe(gulp.dest('./docs'));
});
gulp.task('default', ['fonts', 'lint', 'compile', 'compile-min']);
gulp.task('watch', function(){
gulp.watch('./src/**/*.scss', ['default']);
});
gulp.task('watch-docs', function(){
gulp.watch('./docs/**/*.scss', ['docs']);
});