-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
57 lines (50 loc) · 2.06 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 concat = require('gulp-concat');
const path = require('path');
const fs = require('fs-extra');
const cleanCss = require('gulp-clean-css');
const rev = require('gulp-rev');
let basePath = path.resolve(__dirname);
async function clean() {
await fs.remove(basePath + '/public/build');
}
async function packVendorJs() {
await gulp.src([
basePath + '/node_modules/jquery/dist/jquery.min.js',
basePath + '/node_modules/popper.js/dist/umd/popper.min.js',
basePath + '/node_modules/bootstrap/dist/js/bootstrap.min.js',
basePath + '/node_modules/@fortawesome/fontawesome-free/js/all.min.js',
basePath + '/node_modules/highlightjs/highlight.pack.min.js',
basePath + '/node_modules/bootstrap-markdown-editor-4/dist/js/bootstrap-markdown-editor.min.js'
]).pipe(concat('vendor.js'))
.pipe(rev())
.pipe(gulp.dest('public/build/js'))
.pipe(rev.manifest('public/build/rev-manifest.json', {
merge: true
}))
.pipe(gulp.dest('.'));
};
async function packVendorCss() {
await gulp.src([
basePath + '/node_modules/@fortawesome/fontawesome-free/css/all.min.css',
basePath + '/node_modules/bootstrap/dist/css/bootstrap.min.css',
basePath + '/node_modules/highlightjs/styles/default.css',
basePath + '/node_modules/bootstrap-markdown-editor-4/dist/css/bootstrap-markdown-editor.min.css'
]).pipe(concat('vendor.css'))
.pipe(cleanCss())
.pipe(rev())
.pipe(gulp.dest('public/build/css'))
.pipe(rev.manifest('public/build/rev-manifest.json', {
merge: true
}))
.pipe(gulp.dest('.'));
await gulp.src(basePath + '/node_modules/@fortawesome/fontawesome-free/webfonts/**/*')
.pipe(gulp.dest('public/build/webfonts'));
};
async function packAppCss() {
await gulp.src([
basePath + '/assets/css/style.css',
]).pipe(concat('app.css'))
.pipe(gulp.dest('public/build/css'));
}
exports.default = gulp.series(clean, packVendorJs, packVendorCss, packAppCss);