-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
38 lines (31 loc) · 1.26 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
var gulp = require('gulp'),
fontgen = require('gulp-fontgen'),
replace = require('gulp-replace'),
mergeStream = require('merge-stream'),
runSequence = require('run-sequence');
gulp.task('fontgen', function() {
return gulp.src('dist/print/*.ttf')
.pipe(fontgen({
dest: 'dist/web'
}))
});
gulp.task('fontCleanup', function() {
var regular = gulp.src('dist/web/SeidenSans-Regular.css')
.pipe(replace('font-weight: 300', 'font-weight: 400'))
.pipe(replace('font-family: "Seiden_Sans_Regular"', 'font-family: "Seiden Sans"'))
.pipe(gulp.dest('dist/web'));
var light = gulp.src('dist/web/SeidenSans-Light.css')
.pipe(replace('font-family: "Seiden_Sans_Light"', 'font-family: "Seiden Sans"'))
.pipe(gulp.dest('dist/web'));
var bold = gulp.src('dist/web/SeidenSans-Bold.css')
.pipe(replace('font-family: "Seiden_Sans_Bold"', 'font-family: "Seiden Sans"'))
.pipe(gulp.dest('dist/web'));
return mergeStream(regular, light, bold);
});
gulp.task('watch', function() {
gulp.watch('dist/print/*.ttf', ['fontgen']);
gulp.watch('dist/web/*.css', ['fontCleanup']);
});
gulp.task('default', function() {
runSequence('fontgen', ['fontCleanup', 'watch']);
});