-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
60 lines (46 loc) · 1.29 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
const gulp = require('gulp');
const run = require("gulp-run-command").default;
const include = require('gulp-include');
const {series} = require('gulp');
const CardinalDepPath = "node_modules/cardinal/";
function buildCardinal(cb) {
let currentDir = process.cwd();
process.chdir('../cardinal');
run('npm run build')().then(function () {
process.chdir(currentDir);
cb();
});
};
function buildSitemap(cb) {
run('npm run generate-sitemap')().then(cb);
};
function copyJsFile(cb) {
gulp.src(`${CardinalDepPath}dist/cardinal.js`)
.pipe(include({
separateInputs: true,
}))
.pipe(gulp.dest('./release'));
cb();
};
function copyJsFolderBuild(cb) {
gulp.src(`${CardinalDepPath}dist/cardinal/**/*`)
.pipe(include({
separateInputs: true,
}))
.pipe(gulp.dest('./release/cardinal'));
cb();
}
function copyThemes(cb) {
gulp.src(`${CardinalDepPath}themes/**/*`)
.pipe(include({
separateInputs: true,
}))
.pipe(gulp.dest('./release/themes'));
cb();
}
function copySourceFiles(cb) {
gulp.src('src/**/*')
.pipe(gulp.dest('./release/'));
cb();
}
exports.build = series(buildCardinal, copyJsFile, copyJsFolderBuild, copyThemes, copySourceFiles);