-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
65 lines (56 loc) · 1.66 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var pug = require('gulp-pug');
var clean = require('gulp-clean');
var minify = require('gulp-minify');
var plumber = require('gulp-plumber');
var autowatch = require('gulp-autowatch');
gulp.task('views', function() {
gulp.src('./*.html')
.pipe(plumber())
.pipe(clean())
gulp.src('./demo/assets/views/*.pug')
.pipe(plumber())
.pipe(pug())
.pipe(gulp.dest('./'))
})
gulp.task('stylus', function() {
gulp.src('./demo/assets/styl/*.styl')
.pipe(plumber())
.pipe(stylus({
compress: true
}))
.pipe(gulp.dest('./demo/public/css'))
})
gulp.task('js', function() {
gulp.src('./demo/assets/js/*.js')
.pipe(plumber())
.pipe(minify())
.pipe(gulp.dest('./demo/public/js'))
})
gulp.task('watch', function() {
autowatch(gulp, {
'stylus': './demo/assets/**/*.styl',
'js': './demo/assets/**/*.js',
'views': './demo/assets/**/*.pug',
'default': ['./src/js/*.js', './src/styl/*.styl']
});
});
gulp.task('live', ['default', 'stylus', 'js', 'views', 'watch']);
gulp.task('default', function() {
gulp.src('./src/js/custom-alert.js')
.pipe(minify({
ext: {
src: '-debug.js',
min: '.min.js'
},
exclude: ['tasks'],
ignoreFiles: ['.combo.js', '-min.js']
}))
.pipe(gulp.dest('./dist/js'))
gulp.src(['./src/styl/custom-alert.styl','./src/styl/custom-alert-bootstrap.styl'])
.pipe(stylus({
compress: true
}))
.pipe(gulp.dest('./dist/css'))
})