@hugsmidjan/gulp-iconfont
npm install --save-dev @hugsmidjan/gulp-iconfont
Usage
const [cssBundle, cssWatch] = require('@hugsmidjan/gulp-iconfont')(opts);
API / Advanced usage
const iconfontTaskFactory = require('@hugsmidjan/gulp-iconfont');
const options = {
name: 'iconfont',
src: 'src/',
dist: 'pub/i/',
glob: 'iconfont/*.svg',
fontName: 'icons',
};
const iconfontTasks = iconfontTaskFactory(options);
const [iconfontBundle, iconfontWatch] = iconfontTasks;
const { bundle, watch } = iconfontTasks;
This task generates a set of font-files along with the JSON file
{{options.fontName}}.json
which can be consumed by scripts or other tasks.
The scssFile
and lessFile
options generate LESS/SCSS files with the icon
glyps as named variables.