Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(IconLibrary): fix issue with glyph only icons #2457

Merged
merged 3 commits into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
11 changes: 11 additions & 0 deletions src/components/SVGLibraries/IconLibrary/IconLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ const IconLibrary = () => {

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

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