Converts all SVG files in the same directory to Fontawesome Javascript & Typescript files.
Put your SVG icons and the script in the same folder and run:
php convert.php
All SVG files have to be named in the following manner:
prefix_file_name.svg
❗The SVG file names must be lowercase snake case
SVG source file:
z_my_icon.svg
Resulting icon CSS class:
<span class="z fa-my-icon"></span>
Resulting icon files:
zMyIcon.js
zMyIcon.d.ts
import { library, dom } from '@fortawesome/fontawesome-svg-core';
import { zMyIcon } from './icons/zMyIcon';
library.add(
zMyIcon
);
dom.watch();