-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
52 lines (46 loc) · 1.15 KB
/
gulpfile.js
File metadata and controls
52 lines (46 loc) · 1.15 KB
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
46
47
48
49
50
51
52
var gulp = require('gulp'),
webserver = require('gulp-webserver'),
stylus = require('gulp-stylus'),
nib = require('nib'),
minifyCSS = require('gulp-minify-css'),
nodemon = require('nodemon'),
livereload = require('gulp-livereload'),
notify = require('gulp-notify');
var config = {
styles: {
main: './src/styles/main.styl',
watch: './src/**/*.styl',
output: './public/stylesheets'
},
jade: {
watch: './views/**/*.jade'
}
};
//Tarea de servicio web
gulp.task('server', function () {
livereload.listen();
nodemon({
script: './app.js',
ext: 'jade html js css www'
}).on('restart', function () {
gulp.src('./app.js')
.pipe(livereload())
.pipe(notify('Recargando, espera...'))
console.log('restarted!');
})
});
gulp.task('css', function(){
gulp.src(config.styles.main)
.pipe(stylus({
use: nib(),
'include css': true
}))
.pipe(minifyCSS())
.pipe(gulp.dest(config.styles.output));
console.log('Cambio en CSS.');
});
gulp.task('watch',function(){
gulp.watch(config.styles.watch, ['css']);
});
gulp.task('build',['css']);
gulp.task('default',['server','watch','build']);