-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
36 lines (30 loc) · 886 Bytes
/
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
var gulp = require('gulp');
var gulpConnect = require('gulp-connect');
var gulpLess = require('gulp-less');
var gulpEjs = require('gulp-ejs');
var src = 'src';
var out = 'public';
gulp.task("connect", function () {
return gulpConnect.server({
root: "public",
port: 1337,
livereload: true
});
});
gulp.task('ejs', function () {
return gulp.src([src + '/*.ejs'])
.pipe(gulpEjs())
.pipe(gulp.dest(out + '/'))
.pipe(gulpConnect.reload());
});
gulp.task('less', function () {
return gulp.src('./src/less/**/*.less')
.pipe(gulpLess())
.pipe(gulp.dest('./public/css/'))
.pipe(gulpConnect.reload());
});
gulp.task('watch', function () {
gulp.watch([src + '/less/*.less', src + '/less/**/*.less'], ['less']);
return gulp.watch([src + '/*.ejs', src + '/ejs/**/*.ejs'], ['ejs']);
});
gulp.task('default', ['connect', 'less', 'ejs', 'watch']);