-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
65 lines (56 loc) · 1.59 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 nano = require('gulp-cssnano');
var less = require('gulp-less');
var zip = require('gulp-zip');
var cssBase64 = require('gulp-css-base64');
var jsonlint = require("gulp-jsonlint");
const lessCliend = function () {
return gulp.src('styles/cliend.less')
.pipe(less())
.pipe(nano())
.pipe(gulp.dest('dist/css/'));
};
const lessOther = function () {
return gulp.src([
'styles/**/*.less',
'!styles/cliend.less'
])
.pipe(less())
.pipe(nano())
.pipe(gulp.dest('dist/css/'));
};
exports.less = gulp.series(lessCliend, lessOther);
const datatablesCss = function () {
return gulp.src('libs/datatables/media/css/jquery.dataTables.css')
.pipe(cssBase64())
.pipe(nano())
.pipe(gulp.dest('dist/css/'));
};
exports.default = gulp.parallel(exports.less, datatablesCss);
exports.watch = function () {
gulp.watch([
'styles/**/*.less',
'!styles/cliend.less'
], ['less-other']);
};
exports.manifestLint = function () {
return gulp.src("./manifest.json")
.pipe(jsonlint())
.pipe(jsonlint.reporter());
};
exports.zip = function () {
return gulp.src([
'./**/*',
'!./node_modules/**/*',
'!./node_modules',
'!./styles/**/*.less',
'!./gulpfile.js',
'!./package.json',
'!./bower.json',
'!./.bowerrc',
'!./build.zip'
])
.pipe(zip('build.zip'))
.pipe(gulp.dest('./'));
};
exports.build = gulp.series(gulp.parallel(exports.default, exports.manifestLint), exports.zip);