-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.babel.js
51 lines (46 loc) · 1.51 KB
/
gulpfile.babel.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
/**
* Created by Nitori on 2016/12/30.
*/
'use strict';
import gulp from 'gulp';
import svgmin from 'gulp-svgmin';
import iconfont from 'gulp-iconfont';
import nunjucks from 'gulp-nunjucks';
import generateConstant from './scripts/build/constant/gulp';
import generateLocale from './scripts/build/locale/gulp';
const iconTimestamp = ~~(Date.now() / 1000);
gulp.task('constant', () => {
return gulp
.src('anubis/ui/constant/*.js')
.pipe(generateConstant())
.pipe(gulp.dest('anubis/constant'))
});
gulp.task('iconfont', () => {
return gulp
.src('anubis/ui/misc/icons/*.svg')
.pipe(svgmin())
.pipe(gulp.dest('anubis/ui/misc/icons'))
.pipe(iconfont({
fontHeight: 1000,
prependUnicode: false,
descent: 6.25 / 100 * 1000,
fontName: 'anubisIcon',
formats: ['svg', 'ttf', 'eot', 'woff', 'woff2'],
timestamp: iconTimestamp,
normalize: true,
}))
.on('glyphs', (glyphs, options) => {
gulp
.src('anubis/ui/misc/icons/template/*.styl')
.pipe(nunjucks.compile({glyphs, options}))
.pipe(gulp.dest('anubis/ui/misc/.iconfont'))
})
.pipe(gulp.dest('anubis/ui/misc/.iconfont'));
});
gulp.task('locale', () => {
return gulp
.src('anubis/locale/*.yaml')
.pipe(generateLocale())
.pipe(gulp.dest('anubis/ui/static/locale'))
});
gulp.task('default', ['iconfont', 'constant', 'locale'], () => {});