Unverified Commit 1436a360 authored by Shu Ding's avatar Shu Ding Committed by GitHub

Clean up builtin `modularizeImports` configs (#59294)

Most of them can now be handled by `optimizePackageImports` as I
manually tested them locally. The main benefit is that structural
updates from these libs won't affect our internal configurations
anymore, as they're automatic with the new approach. The little downside
is that the automatic way is a bit slower than the `modularizeImports`
config as it needs to do extra analyzation. But overall, this is a good
direction.

Depends on #59254.
parent 78a2eb0b
......@@ -808,47 +808,9 @@ function assignDefaults(
'@mui/icons-material': {
transform: '@mui/icons-material/{{member}}',
},
'date-fns': {
transform: 'date-fns/{{member}}',
},
lodash: {
transform: 'lodash/{{member}}',
},
'lodash-es': {
transform: 'lodash-es/{{member}}',
},
ramda: {
transform: 'ramda/es/{{member}}',
},
'react-bootstrap': {
transform: {
useAccordionButton:
'modularize-import-loader?name=useAccordionButton&from=named&as=default!react-bootstrap/AccordionButton',
'*': 'react-bootstrap/{{member}}',
},
},
antd: {
transform: 'antd/es/{{kebabCase member}}',
},
ahooks: {
transform: {
createUpdateEffect:
'modularize-import-loader?name=createUpdateEffect&from=named&as=default!ahooks/es/createUpdateEffect',
'*': 'ahooks/es/{{member}}',
},
},
'@ant-design/icons': {
transform: {
IconProvider:
'modularize-import-loader?name=IconProvider&from=named&as=default!@ant-design/icons',
createFromIconfontCN: '@ant-design/icons/es/components/IconFont',
getTwoToneColor:
'modularize-import-loader?name=getTwoToneColor&from=named&as=default!@ant-design/icons/es/components/twoTonePrimaryColor',
setTwoToneColor:
'modularize-import-loader?name=setTwoToneColor&from=named&as=default!@ant-design/icons/es/components/twoTonePrimaryColor',
'*': '@ant-design/icons/lib/icons/{{member}}',
},
},
'next/server': {
transform: 'next/dist/server/web/exports/{{ kebabCase member }}',
},
......@@ -863,6 +825,13 @@ function assignDefaults(
...new Set([
...userProvidedOptimizePackageImports,
'lucide-react',
'date-fns',
'lodash-es',
'ramda',
'antd',
'react-bootstrap',
'ahooks',
'@ant-design/icons',
'@headlessui/react',
'@headlessui-float/react',
'@heroicons/react/20/solid',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment