diff --git a/.babelrc b/.babelrc index 512dd73..4c2f8ed 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,4 @@ { "presets": ["next/babel"], - "plugins": ["babel-plugin-macros"] + "plugins": ["codegen","babel-plugin-macros"] } \ No newline at end of file diff --git a/src/utils/iconList.ts b/src/utils/iconList.ts index 9ea18e5..70743a5 100644 --- a/src/utils/iconList.ts +++ b/src/utils/iconList.ts @@ -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() \ No newline at end of file + .flat(); + +module.exports = `export default [${icons.join(", ")}];`; \ No newline at end of file