-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
67 lines (53 loc) · 2.38 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
66
67
const { parallel, src, dest } = require('gulp');
const purgeCSS = require('gulp-purgecss')
const cleanCSS = require('gulp-clean-css');
const concat = require('gulp-concat');
function adminCSS() {
return src('node_modules/ng-admin/build/ng-admin.min.css', { sourcemaps: true }).pipe(dest("static/css", { sourcemaps: '.' }))
}
function adminJS() {
return src('node_modules/ng-admin/build/ng-admin.min.js', { sourcemaps: true }).pipe(dest("static/js", { sourcemaps: '.' }))
}
function mainCSS() {
return src("src/css/*.css").pipe(src('node_modules/bootstrap/dist/css/bootstrap.min.css')).pipe(purgeCSS({
content: [
'internal/web/templates/*.templ',
'internal/web/templates/**/*.templ'
],
safelist: {
deep: [/^modal/]
}
})).pipe(src('node_modules/select2/dist/css/select2.min.css'))
.pipe(src('node_modules/@ttskch/select2-bootstrap4-theme/dist/select2-bootstrap4.min.css'))
.pipe(cleanCSS({compatibility: 'ie8'})).pipe(concat('main.min.css')).pipe(dest("static/css"))
}
function mainJS() {
return src("src/js/*.js").pipe(dest("static/js"))
}
function bootstrapJS() {
return src('node_modules/bootstrap/dist/js/bootstrap.min.js', {sourcemaps: true}).pipe(dest('static/js', {sourcemaps: '.'}))
}
function bootstrapIcons() {
return src('node_modules/bootstrap-icons/**/*').pipe(dest('static/bootstrap-icons'))
}
function selectCSS() {
return src('node_modules/select2/dist/css/select2.min.css').pipe(dest('static/css'))
}
function selectJS() {
return src('node_modules/select2/dist/js/select2.min.js', {sourcemaps: true}).pipe(dest('static/js', {sourcemaps: '.'}))
}
function jqueryJS() {
return src('node_modules/jquery/dist/jquery.slim.min.js', {sourcemaps: true}).pipe(dest('static/js', {sourcemaps: '.'}))
}
function katex() {
return src('node_modules/katex/dist/**/*').pipe(dest('static/katex'))
}
function mainFavicon() {
return src("src/favicon.ico").pipe(src("src/*.png")).pipe(src("src/site.webmanifest")).pipe(dest("static"))
}
function popperJS() {
return src('node_modules/popper.js/dist/umd/popper.min.js', {sourcemaps: true}).pipe(dest('static/js', {sourcemaps: '.'}))
}
const admin = parallel(adminCSS, adminJS)
const main = parallel(mainCSS, mainJS, mainFavicon, bootstrapJS, selectCSS, selectJS, jqueryJS, katex, bootstrapIcons, popperJS)
exports.default = parallel(admin, main)