fix: bundle pixealrticons with the app instead of fetching them from remote location in runtime
This commit is contained in:
parent
a6fc5de1f9
commit
d8261c2659
19 changed files with 1102 additions and 69 deletions
16
scripts/genPixelartTypes.ts
Normal file
16
scripts/genPixelartTypes.ts
Normal 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 = ''
|
||||
str += ` /** ${jsdocImage} */\n`
|
||||
str += ` '${name}': string;\n`
|
||||
}
|
||||
str += '}\n'
|
||||
fs.writeFileSync('./src/react/pixelartIcons.generated.ts', str, 'utf8')
|
||||
Loading…
Add table
Add a link
Reference in a new issue