fix: bundle pixealrticons with the app instead of fetching them from remote location in runtime

This commit is contained in:
Vitaly Turovsky 2024-07-07 19:18:48 +03:00
commit d8261c2659
19 changed files with 1102 additions and 69 deletions

View file

@ -0,0 +1,16 @@
import fs from 'fs'
const icons = fs.readdirSync('node_modules/pixelarticons/svg')
const addIconPath = '../../node_modules/pixelarticons/svg/'
let str = 'export type PixelartIconsGenerated = {\n'
for (const icon of icons) {
const name = icon.replace('.svg', '')
// jsdoc
const jsdocImage = '![image](' + addIconPath + icon + ')'
str += ` /** ${jsdocImage} */\n`
str += ` '${name}': string;\n`
}
str += '}\n'
fs.writeFileSync('./src/react/pixelartIcons.generated.ts', str, 'utf8')