mirror of
https://github.com/Xevion/icons.git
synced 2025-12-09 16:07:31 -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"],
|
"presets": ["next/babel"],
|
||||||
"plugins": ["babel-plugin-macros"]
|
"plugins": ["codegen","babel-plugin-macros"]
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,13 @@
|
|||||||
// @ts-nocheck
|
|
||||||
// @codegen
|
// @codegen
|
||||||
|
// @ts-nocheck
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
|
||||||
// @ts-ignore
|
// @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 => (
|
.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