-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gulpfile.js
45 lines (41 loc) · 1.21 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
var gulp = require('gulp'),
less = require('gulp-less'),
path = require('path'),
prefix = require('gulp-autoprefixer'),
minifyCSS = require('gulp-minify-css')
server = require('tiny-lr')(),
plumber = require('gulp-plumber'),
livereload = require('gulp-livereload');
gulp.task('styles', function() {
gulp
.src('css/less/main.less')
.pipe(plumber())
.pipe(less({
paths: [path.join(__dirname, 'less')]
}))
.pipe(prefix("last 2 versions", "> 1%", "ie 8", "ie 7"))
.pipe(minifyCSS())
.pipe(gulp.dest('./css'))
.pipe(livereload(server));
});
gulp.task('scripts', function() {
gulp
.src('js/*.js')
.pipe(plumber())
.pipe(livereload(server));
});
gulp.task('views', function() {
gulp
.src('*.html')
.pipe(plumber())
.pipe(livereload(server));
});
// The default task (called when you run `gulp`)
gulp.task('default', function() {
server.listen(35729, function(err) {
if (err) return console.log(err);
gulp.watch('css/less/*.less', ['styles']);
gulp.watch('js/*.js', ['scripts']);
gulp.watch(['*.html','*.md','*.yaml'], ['views']);
});
});