-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (36 loc) · 1.22 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
cssmin = require('gulp-cssmin'),
rename = require('gulp-rename'),
shell = require('gulp-shell'),
uglify = require('gulp-uglify');
gulp.task('watch', ['build'], function () {
gulp.watch('./violet/src/scss/**/*.scss', ['build:scss']);
gulp.watch('./violet/src/js/**/*.js', ['build:js']);
});
gulp.task('scss', function () {
return gulp.src('./violet/src/scss/violet.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./violet/dist'));
});
gulp.task('js', function () {
return gulp.src('./violet/src/js/violet.js')
.pipe(gulp.dest('./violet/dist'));
})
gulp.task('build:scss', ['scss'], function () {
return gulp.src('./violet/dist/violet.css')
.pipe(cssmin())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./violet/dist'));
});
gulp.task('build:js', ['js'], function () {
return gulp.src('./violet/dist/violet.js')
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./violet/dist'));
});
gulp.task('build', ['build:js', 'build:scss']);
gulp.task('serve', ['watch'], shell.task([
'jekyll serve'
]));
gulp.task('default', ['build']);