-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
43 lines (38 loc) · 1.03 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
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var connect = require('gulp-connect');
var autoprefixer = require('gulp-autoprefixer');
gulp.task('dev', function () {
connect.server({
root: ['./'],
port: 8000,
livereload: true,
middleware: function () {
return [function (req, res, next) {
if (/\.ico$/.test(req.url)) {
return res.end('no found.');
}
next();
}];
}
});
});
gulp.task('stylus', function () {
gulp.src('./src/*.styl')
.pipe(stylus())
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('./dist'))
.pipe(connect.reload());
});
gulp.task('html', function () {
gulp.src('./*.html')
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch(['./*.html'], ['html']);
gulp.watch(['./src/*.styl'], ['stylus']);
});
gulp.task('default', ['dev', 'watch']);