From 10250119dfed2a40fb65cdad171094fb916293e2 Mon Sep 17 00:00:00 2001 From: Shu Ding Date: Tue, 19 Sep 2023 13:39:16 +0200 Subject: [PATCH] Add react-icons to optimizePackageImports (#55572) Follow-up for #55310. --- packages/next/src/server/config.ts | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/packages/next/src/server/config.ts b/packages/next/src/server/config.ts index a3462031ce225..5fbe97a799e5b 100644 --- a/packages/next/src/server/config.ts +++ b/packages/next/src/server/config.ts @@ -725,6 +725,42 @@ function assignDefaults( '@material-ui/icons', '@tabler/icons-react', 'mui-core', + // We don't support wildcard imports for these configs, e.g. `react-icons/*` + // so we need to add them manually. + // In the future, we should consider automatically detecting packages that + // need to be optimized. + 'react-icons/ai', + 'react-icons/bi', + 'react-icons/bs', + 'react-icons/cg', + 'react-icons/ci', + 'react-icons/di', + 'react-icons/fa', + 'react-icons/fa6', + 'react-icons/fc', + 'react-icons/fi', + 'react-icons/gi', + 'react-icons/go', + 'react-icons/gr', + 'react-icons/hi', + 'react-icons/hi2', + 'react-icons/im', + 'react-icons/io', + 'react-icons/io5', + 'react-icons/lia', + 'react-icons/lib', + 'react-icons/lu', + 'react-icons/md', + 'react-icons/pi', + 'react-icons/ri', + 'react-icons/rx', + 'react-icons/si', + 'react-icons/sl', + 'react-icons/tb', + 'react-icons/tfi', + 'react-icons/ti', + 'react-icons/vsc', + 'react-icons/wi', ]), ]