mirror of
https://github.com/Xevion/icons.git
synced 2025-12-05 23:15:17 -06:00
Fix build-time codegen icon list building, Add codegen to babel plugins
This commit is contained in:
2
.babelrc
2
.babelrc
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"presets": ["next/babel"],
|
||||
"plugins": ["babel-plugin-macros"]
|
||||
"plugins": ["codegen","babel-plugin-macros"]
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
// @ts-nocheck
|
||||
// @codegen
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
|
||||
// @ts-ignore
|
||||
module.exports = require("./icons").ICON_SET_IDS
|
||||
const identifiers = require("react-icons/lib").IconsManifest.map(pack => pack.id);
|
||||
const icons = identifiers
|
||||
.map(setId => Object.keys(require(`react-icons/${setId}/index`)).map(id => (
|
||||
{id, setId}
|
||||
`{id: "${id}", setId: "${setId}"}`
|
||||
)))
|
||||
.flat()
|
||||
.flat();
|
||||
|
||||
module.exports = `export default [${icons.join(", ")}];`;
|
||||
Reference in New Issue
Block a user