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
| var gulp = require("gulp"); var fontmin = require("gulp-fontmin");
function minifyFont(text, cb) { gulp .src("source/font/*.ttf") .pipe( fontmin({ text: text, }) ) .pipe(gulp.dest("source/fontdest/")) .on("end", cb); }
gulp.task("mini-font", (cb) => { var buffers = [];
gulp .src(["./.deploy_git/**/*.html"]) .on("data", function (file) { buffers.push(file.contents); }) .on("end", function () { var text = Buffer.concat(buffers).toString("utf-8"); minifyFont(text, cb); }); });
gulp.task("default", gulp.parallel("mini-font"));
|