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