-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
59 lines (51 loc) · 1.91 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
var gulp = require('gulp'),
$ = require('gulp-load-plugins')(),
sourceDirectory = 'src/',
buildDirectory = 'dist/',
bowerComponentsDirectory = 'bower_components/';
gulp.task('build-html', function() {
return gulp.src(sourceDirectory + 'jade/*.jade')
.pipe($.plumber())
.pipe($.jade({
pretty: true
}))
.pipe(gulp.dest(buildDirectory))
.pipe($.livereload());
});
gulp.task('build-css', function() {
return gulp.src([sourceDirectory + 'css/reset.min.css',
bowerComponentsDirectory + 'nouislider/distribute/nouislider.min.css',
sourceDirectory + 'scss/*.scss'])
.pipe($.plumber())
.pipe($.sass())
.pipe($.autoprefixer({
browsers: ['last 3 versions'],
cascade: false
}))
.pipe($.cssnano())
.pipe($.concat('style.css'))
.pipe(gulp.dest(buildDirectory + 'css'))
.pipe($.livereload());
});
gulp.task('build-js', function() {
gulp.src(bowerComponentsDirectory + 'nouislider/distribute/nouislider.min.js')
.pipe($.plumber())
.pipe($.concat('components.js'))
.pipe($.uglify())
.pipe(gulp.dest(buildDirectory + 'js'));
return gulp.src([sourceDirectory + 'coffee/**/*.coffee'])
.pipe($.plumber())
.pipe($.concat('script.coffee'))
.pipe($.coffee())
.pipe($.concat('script.js'))
.pipe(gulp.dest(buildDirectory + 'js'))
.pipe($.livereload());
});
gulp.task('watch', function() {
$.livereload.listen();
gulp.watch(sourceDirectory + 'jade/**/*.jade', gulp.parallel('build-html'));
gulp.watch(sourceDirectory + 'scss/**/*.scss', gulp.parallel('build-css'));
gulp.watch(sourceDirectory + 'coffee/**/*.coffee', gulp.parallel('build-js'));
});
gulp.task('build', gulp.parallel('build-html', 'build-css', 'build-js'));
gulp.task('default', gulp.parallel('build'));