-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
54 lines (44 loc) · 1.25 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 connect = require('gulp-connect');
var uglify = require('gulp-uglify');
var minifyCSS = require('gulp-minify-css')
var babel = require("gulp-babel");
var clean = require('gulp-clean');
gulp.task('clean', () => {
return gulp.src('dist', {read: false, allowEmpty: true})
.pipe(clean());
})
gulp.task('copy', () => {
return gulp.src(["layui*/**", "wfui*/**/*.*", "app.config.js", "favicon.ico", "*.html", "*.jpg"])
.pipe(gulp.dest('dist/'));
});
gulp.task("toes5", function () {
return gulp.src(["dist/wfui/**/*.js", "!dist/wfui/plugins/**/*.js"])
.pipe(babel())
.pipe(gulp.dest("dist/wfui/"))
});
gulp.task('compressJS', function () {
return gulp.src(['dist/*.js', 'dist/wfui/**/*.js', "!dist/wfui/plugins/**/*.js"])
.pipe(uglify({
mangle: true
}))
.pipe(gulp.dest('dist/wfui/'));
});
gulp.task('compressCSS', function () {
return gulp.src('dist/wfui/**/*.css')
.pipe(minifyCSS())
.pipe(gulp.dest('dist/wfui/'))
})
gulp.task('build', gulp.series(
'clean',
'copy',
'toes5',
'compressJS',
'compressCSS',
));
gulp.task("run", function () {
connect.server({
livereload: true,
port: 6632
});
})