-
Notifications
You must be signed in to change notification settings - Fork 500
/
gulpfile.js
56 lines (50 loc) · 1.12 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
const del = require('del')
const gulp = require('gulp')
const path = require('path')
const debug = require('gulp-debug')
const rootPath = path.join(__dirname, 'src')
function copyExample(dir) {
return gulp
.src(['src/**/*'], {
base: rootPath
})
.pipe(
debug({
title: '复制:'
})
)
.pipe(gulp.dest(dir))
}
function CopyCompJs() {
return gulp
.src('calendar-dist/*')
.pipe(
debug({
title: '复制:'
})
)
.pipe(gulp.dest('calendar_v1'))
}
function copyCalendar() {
return gulp
.src([
'src/component/calendar/**/*',
'!src/component/calendar/*.js',
'!src/component/calendar/{func,func/*}'
])
.pipe(
debug({
title: '复制:'
})
)
.pipe(gulp.dest('calendar_v1'))
}
exports.copyCalendar = gulp.series(copyCalendar, CopyCompJs)
gulp.task('default', gulp.series(copyCalendar, CopyCompJs))
gulp.task('example', () => copyExample('example'))
gulp.task('clean', function() {
return del(['calendar-dist'])
})
gulp.task('watch', () => {
gulp.watch(['src/**/*', 'src/*'], () => copyExample('dist'))
})