-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (39 loc) · 997 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
37
38
39
40
41
42
43
44
45
// Load Gulp and your plugins
var gulp = require('gulp'),
connect = require('gulp-connect'),
stylus = require('gulp-stylus'),
plumber = require('gulp-plumber');
var paths = {
styles: 'src/stylus/**/*',
html: '*.html'
};
// Connect task
gulp.task('connect', connect.server({
root: __dirname + '/',
port: 5000,
livereload: true,
open: true
}));
// HTML task
gulp.task('html', function () {
gulp.src('*.html')
.pipe(connect.reload());
});
// Stylus task
gulp.task('stylus', function () {
gulp.src('./src/stylus/*.styl')
.pipe(plumber())
.pipe(stylus({
use: ['nib'],
set: ['compress']
}))
.pipe(gulp.dest('./assets/css'))
.pipe(connect.reload());
});
// Watch task
gulp.task('watch', function () {
gulp.watch(paths.styles, ['stylus']);
gulp.watch(paths.html, ['html']);
});
// Set 'gulp server' for development
gulp.task('server', ['connect', 'stylus', 'watch']);