Skip to content

Commit

Permalink
fix(IconLibrary): change path
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan committed Jul 28, 2021
1 parent bb40847 commit 02f0177
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dev": "gatsby develop -H 0.0.0.0",
"dev:clean": "gatsby clean && yarn dev",
"clean": "gatsby clean",
"build": "node --max-old-space-size=4096 ./node_modules/.bin/gatsby build",
"build": "node --max-old-space-size=8192 ./node_modules/.bin/gatsby build",
"build:clean": "gatsby clean && yarn build",
"build:analyze": "yarn install --force && yarn clean && ANALYZE=true yarn build",
"serve": "gatsby serve",
Expand Down
17 changes: 12 additions & 5 deletions src/components/SVGLibraries/IconLibrary/IconLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,23 @@ const IconLibrary = () => {

const path = [...icon.namespace, icon.name].join('/');

const glyphOnly = icon.sizes.length === 1 && icon.sizes[0] === 'glyph';

if (icon.sizes.length === 1 && icon.sizes[0] === 'glyph') {
return [
...accumulator,
{
...icon,
Component: loadable(() =>
import(`@carbon/icons-react/lib/${path}/index`)
),
},
];
}
return [
...accumulator,
{
...icon,
Component: loadable(() =>
import(
`@carbon/icons-react/lib/${path}/${glyphOnly ? 'index' : '32'}`
)
import(`@carbon/icons-react/lib/${path}/32`)
),
},
];
Expand Down

0 comments on commit 02f0177

Please sign in to comment.