-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
48 lines (43 loc) · 1.06 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
46
47
48
// include the required packages.
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var watch = require('gulp-watch');
var plumber = require('gulp-plumber');
var nodemon = require('gulp-nodemon');
var uglify = require('gulp-uglify');
gulp.task('stylus', function () {
return gulp.src([
'./stylus/base.styl'
])
.pipe(stylus({
compress: true
}))
.pipe(gulp.dest('./static/css'));
});
gulp.task('watch', function (cb) {
nodemon({
script: 'server.js'
, ext: 'js html'
, env: { 'NODE_ENV': 'development' }
})
return gulp.src('./stylus/base.styl')
.pipe(plumber({errorHandler: function (err) {
console.log(err);
}}))
.pipe(watch('./stylus/**/*.styl'))
.pipe(stylus({
compress: true
}))
.pipe(gulp.dest('./static/css'));
});
gulp.task('uglify', function() {
return gulp.src([
'js/*.js',
'node_modules/angular/angular.js'
])
// .pipe(uglify({mangle: false}))
.pipe(gulp.dest('./static/js'));
});
gulp.task('default', [], function() {
gulp.start('stylus', 'uglify');
});