mirror of
https://github.com/feathericons/feather.git
synced 2023-08-10 21:13:24 +03:00
20 lines
558 B
JavaScript
20 lines
558 B
JavaScript
|
import fs from 'fs';
|
||
|
import path from 'path';
|
||
|
|
||
|
import buildIconsObject from './build-icons-object';
|
||
|
|
||
|
const IN_DIR = path.resolve(__dirname, '../icons');
|
||
|
const OUT_FILE = path.resolve(__dirname, '../dist/icons.json');
|
||
|
|
||
|
console.log(`Building ${OUT_FILE}`); // eslint-disable-line no-console
|
||
|
|
||
|
const svgFiles = fs
|
||
|
.readdirSync(IN_DIR)
|
||
|
.filter(file => path.extname(file) === '.svg');
|
||
|
|
||
|
const getSvg = svgFile => fs.readFileSync(path.join(IN_DIR, svgFile));
|
||
|
|
||
|
const icons = buildIconsObject(svgFiles, getSvg);
|
||
|
|
||
|
fs.writeFileSync(OUT_FILE, JSON.stringify(icons));
|