-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
45 lines (41 loc) · 1.29 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
/*******************************************************************************
* Dependencies
*/
var gulp = require('gulp');
var log = require('gulp-util').log;
var rename = require('gulp-rename');
var stylus = require('gulp-stylus');
var nib = require('nib');
var plumber = require('gulp-plumber');
/*******************************************************************************
* Configurations
*/
var config = {
watch: './src/**/*.*',
css: {
src: './src/style.styl',
destination: 'dist'
}
};
/*******************************************************************************
* Stylus task (optional to change the name of the file)
*/
gulp.task('styles', function() {
gulp.src(config.css.src)
.pipe(plumber())
.pipe(stylus({ use: nib() }))
.pipe(rename('style.css'))
.pipe(gulp.dest(config.css.destination));
});
/*******************************************************************************
* Watch task
*/
gulp.task('watch', function() {
log('Watching files');
gulp.watch(config.watch, ['build']);
});
/*******************************************************************************
* Command line task commands
*/
gulp.task('build', ['styles']);
gulp.task('default', ['build', 'watch']);