Skip to content

Commit

Permalink
Automatically modularizeImports for the popular @headlessui/react lib…
Browse files Browse the repository at this point in the history
…rary (#54188)

`import { Listbox } from "@headlessui-float/react";` becomes
`import { Listbox } from "@headlessui/react/dist/components/listbox/listbox";`
  • Loading branch information
cramforce committed Aug 17, 2023
1 parent 7114929 commit 631018a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/next/src/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,11 @@ function assignDefaults(
'*': 'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/{{ kebabCase member }}!lucide-react',
},
},
'@headlessui/react': {
transform:
'modularize-import-loader?name={{member}}&join=./components/{{lowerCase member}}/{{lowerCase member}}!@headlessui/react',
skipDefaultConversion: true,
},
'@heroicons/react/20/solid': {
transform: '@heroicons/react/20/solid/esm/{{member}}',
},
Expand Down

0 comments on commit 631018a

Please sign in to comment.