This repository has been archived by the owner on Aug 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
63 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
const { watch, series, parallel } = require('gulp');
const gulp = require('gulp');
const uglify = require('gulp-uglify');
const sass = require('gulp-sass')(require('sass'));
const autoprefixer = require('gulp-autoprefixer');
const rtlcss = require('gulp-rtlcss');
const cssnano = require('gulp-cssnano');
const rename = require("gulp-rename");
const zip = require('gulp-zip');
function exportcss() {
return gulp.src('./src/sass/**/*.sass')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
cascade: false
}))
.pipe(gulp.dest('./src/css'));
};
exports.exportcss = exportcss;
exports.watch = function () {
gulp.watch('./src/sass/**/*.sass', exportcss);
};
function build() {
return gulp.src('./src/css/GodUi.css')
.pipe(cssnano())
.pipe(rename(function (path) {
path.extname = ".min.css";
}))
.pipe(gulp.dest('./build'))
};
function buildrtl() {
return gulp.src('./src/css/GodUi.css')
.pipe(rtlcss())
.pipe(cssnano())
.pipe(rename(function (path) {
path.extname = ".rtl.min.css";
}))
.pipe(gulp.dest('./build'))
};
function buildjs() {
return gulp.src('./src/js/*.js')
.pipe(uglify())
.pipe(rename(function (path) {
path.extname = ".min.js";
}))
.pipe(gulp.dest('./build'))
};
function buildzip() {
return gulp.src('./build/**/*')
.pipe(zip('GodUi.zip'))
.pipe(gulp.dest('./build'))
}
exports.buildjs = buildjs;
exports.build = build;
exports.buildrtl = buildrtl;
exports.buildzip = buildzip;
exports.compile, exports.default = gulp.series(exportcss, parallel(build, buildrtl), buildjs, buildzip);