-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgulpfile.mjs
70 lines (63 loc) · 1.99 KB
/
gulpfile.mjs
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
68
69
70
import gulp from 'gulp';
import rename from 'gulp-rename';
import copy from 'gulp-copy';
import consolidate from 'gulp-consolidate';
import iconFont from 'gulp-iconfont';
import zip from 'gulp-zip';
gulp.task('icons', () => {
return gulp.src('iconGenerator/assets/icons/files/*.svg')
.pipe(copy('public', { prefix: 2 }))
.pipe(iconFont({
fontName: 'icons',
formats: ['eot', 'woff', 'ttf'],
normalize: true,
fontHeight: 1000,
centerHorizontally: true,
appendCodepoints: true,
prependUnicode: false,
}))
.on('glyphs', function (glyphs, options) {
gulp.src('assets/iconfont.ejs', {})
.pipe(consolidate('underscore', { glyphs: glyphs }))
.pipe(rename('index.ts'))
.pipe(gulp.dest('public/icons/files'));
});
});
gulp.task('folders', () => {
return gulp.src('iconGenerator/assets/icons/folders/*.svg')
.pipe(copy('public', { prefix: 2 }))
.pipe(iconFont({
fontName: 'folders',
formats: ['eot', 'woff', 'ttf'],
normalize: true,
fontHeight: 1000,
centerHorizontally: true,
appendCodepoints: true,
prependUnicode: false,
}))
.on('glyphs', function (glyphs, options) {
gulp.src('assets/folderIconfont.ejs', {})
.pipe(consolidate('underscore', { glyphs: glyphs }))
.pipe(rename('index.ts'))
.pipe(gulp.dest('public/icons/folders'));
});
});
gulp.task('assets', () => {
return gulp.src([
'iconGenerator/icon_associations.json',
'iconGenerator/folder_associations.json',
'assets/global.css',
])
.pipe(copy('public', { prefix: 1 }));
});
gulp.task('prepare', gulp.series('icons', 'folders', 'assets'));
gulp.task('copy', () => {
return gulp.src(['*.*', '!release.zip', 'dist/*.css', 'public/**/*'], { allowEmpty: true })
.pipe(copy('release'));
});
gulp.task('zip', () => {
return gulp.src('release/**/*')
.pipe(zip('release.zip'))
.pipe(gulp.dest('.'));
});
gulp.task('release', gulp.series('prepare', 'copy', 'zip'));