-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
53 lines (48 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
46
47
48
49
50
51
52
53
var gulp = require('gulp')
var plumber = require('gulp-plumber')
var less = require('gulp-less')
var autoprefixer = require('gulp-autoprefixer')
var del = require('del')
gulp.task('misc', function () {
gulp.src([
'bower_components/lodash/lodash.min.js',
'bower_components/jquery/dist/jquery.min.js',
'bower_components/jquery/dist/jquery.min.map',
'bower_components/jquery.serializeJSON/jquery.serializejson.min.js'
])
.pipe(plumber())
.pipe(gulp.dest('static/dist'))
})
gulp.task('external', ['misc'])
gulp.task('less', function () {
gulp.src([
'src/web/channel-open.less',
'src/web/channel-view.less'
])
.pipe(plumber())
.pipe(less())
.pipe(autoprefixer({
browsers: 'Android 4, iOS 6, last 20 versions'
}))
.pipe(gulp.dest('static/dist/app'))
})
gulp.task('js', function () {
gulp.src([
'src/web/**/*.js'
])
.pipe(plumber())
.pipe(gulp.dest('static/dist/app'))
})
gulp.task('source', ['less', 'js'])
gulp.task('clean', function (cb) {
del([
'static/dist'
], cb)
})
gulp.task('build', ['external', 'source'])
gulp.task('watch', ['build'], function () {
gulp.watch('src/web/**/*.less', ['less'])
gulp.watch('src/web/**/*.js', ['js'])
gulp.watch('src/web/**/*.html', ['html'])
})
gulp.task('default', ['build', 'watch'])