-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
51 lines (44 loc) · 1.01 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
const gulp = require("gulp")
const cleanCSS = require('gulp-clean-css')
const less = require("gulp-less")
const rename = require('gulp-rename')
const autoprefixer = require('gulp-autoprefixer')
const del = require('del')
const {src, dest, series} = gulp
//编译 less
function build(cb) {
src('./src/style/index.less')
.pipe(less({style: 'expanded'}))
.pipe(autoprefixer('last 3 version', 'safari 5', 'ie 8', 'ie 9'))
.pipe(cleanCSS())
.pipe(rename('plugRQw.min.css'))
.pipe(dest('./lib'))
cb()
}
// 拷贝字体文件
function fonts(cb) {
src([
'./src/style/iconfont/*.svg',
'./src/style/iconfont/*.ttf',
'./src/style/iconfont/*.woff',
'./src/style/iconfont/*.woff2'
])
.pipe(dest('./lib/iconfont'))
cb()
}
//拷贝国际化文件
function lang(cb) {
src([
'./src/locale/lang/*.js'
])
.pipe(dest('./lib/lang'))
cb()
}
function clean(cb) {
del([
'plugRQw.min.css',
'./lab/iconfont/'
])
cb()
}
exports.default = series(clean, build, fonts, lang)