Skip to content

Commit 1025011

Browse files
authored
Add react-icons to optimizePackageImports (#55572)
Follow-up for #55310.
1 parent d5c35a1 commit 1025011

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

packages/next/src/server/config.ts

+36
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,42 @@ function assignDefaults(
725725
'@material-ui/icons',
726726
'@tabler/icons-react',
727727
'mui-core',
728+
// We don't support wildcard imports for these configs, e.g. `react-icons/*`
729+
// so we need to add them manually.
730+
// In the future, we should consider automatically detecting packages that
731+
// need to be optimized.
732+
'react-icons/ai',
733+
'react-icons/bi',
734+
'react-icons/bs',
735+
'react-icons/cg',
736+
'react-icons/ci',
737+
'react-icons/di',
738+
'react-icons/fa',
739+
'react-icons/fa6',
740+
'react-icons/fc',
741+
'react-icons/fi',
742+
'react-icons/gi',
743+
'react-icons/go',
744+
'react-icons/gr',
745+
'react-icons/hi',
746+
'react-icons/hi2',
747+
'react-icons/im',
748+
'react-icons/io',
749+
'react-icons/io5',
750+
'react-icons/lia',
751+
'react-icons/lib',
752+
'react-icons/lu',
753+
'react-icons/md',
754+
'react-icons/pi',
755+
'react-icons/ri',
756+
'react-icons/rx',
757+
'react-icons/si',
758+
'react-icons/sl',
759+
'react-icons/tb',
760+
'react-icons/tfi',
761+
'react-icons/ti',
762+
'react-icons/vsc',
763+
'react-icons/wi',
728764
]),
729765
]
730766

0 commit comments

Comments
 (0)