Dive into secure and efficient coding practices with our curated list of the top 10 examples showcasing 'gulp-iconfont' in functional components in JavaScript. Our advanced machine learning engine meticulously scans each line of code, cross-referencing millions of open source libraries to ensure your implementation is not just functional, but also robust and secure. Elevate your React applications to new heights by mastering the art of handling side effects, API calls, and asynchronous operations with confidence and precision.
const generateFont = (name = 'BpkIcon') =>
gulp
.src('src/icons/**/*.svg')
.pipe(chmod(0o644))
.pipe(
iconfont({
metadataProvider: getIconFontMetadataProvider(
'tasks/codepoints.json',
),
fontName: name,
formats: ['ttf', 'eot', 'woff'],
/**
* Normalize and fontHeight(>1000) are needed in order to have all the glyphs rendered
* correctly, for more info go to the npm package docs
* https://www.npmjs.com/package/gulp-iconfont
*/
normalize: true,
fontHeight: 1001,
timestamp: 1436442578, // A static timestamp to prevent changes showing up in git, backpack's first commit!
}),
);
gulp.task('build-iconfont', function(){
let runTimestamp = Math.round(Date.now()/1000);
return gulp.src([iconfont_dir + '/**/*.svg'])
.pipe(iconfont({
fontName: 'erudicon',
formats: ['ttf', 'eot', 'woff', 'svg'],
normalize: true,
fontHeight: 1001,
timestamp: runTimestamp
}))
.on('glyphs', function(glyphs, options) {
// CSS templating, e.g.
gulp.src(iconfont_dir + '/template.scss')
.pipe(consolidate('lodash', {
glyphs: glyphs,
fontName: 'erudicon',
fontPath: '/static/fonts/erudicon/',
className: 'erudicon'
}))
.pipe(rename('_erudicon.scss'))
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'));
});