-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
44 lines (38 loc) · 926 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
var gulp = require('gulp');
var webserver = require('gulp-webserver');
var stylus = require('gulp-stylus');
var nib = require('nib');
var cleanCSS = require('gulp-clean-css');
var config = {
styles: {
main: './dev/stylus/main.styl',
watch: './dev/stylus/**/*.styl',
output: './build/css'
},
html: {
watch: './*.html'
}
};
gulp.task('server', function() {
gulp.src('./')
.pipe(webserver({
host: '0.0.0.0',
port: 8080,
livereload: true
}));
});
gulp.task('build:css', function() {
gulp.src(config.styles.main)
.pipe(stylus({
use: nib(),
'include css': true
}))
.pipe(cleanCSS())
.pipe(gulp.dest(config.styles.output));
});
gulp.task('watch', function() {
gulp.watch(config.styles.watch, ['build:css']);
gulp.watch(config.html.watch, ['build']);
});
gulp.task('build', ['build:css']);
gulp.task('default', ['server', 'watch', 'build']);