Skip to content

Commit 33d04fc

Browse files
committed
Add @phosphor-icons/react to the import optimization list
1 parent 03ce7f5 commit 33d04fc

File tree

4 files changed

+35
-16
lines changed

4 files changed

+35
-16
lines changed

Diff for: docs/01-app/04-api-reference/05-config/01-next-config-js/optimizePackageImports.mdx

+17-16
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,29 @@ module.exports = {
1919

2020
The following libraries are optimized by default:
2121

22-
- `lucide-react`
23-
- `date-fns`
24-
- `lodash-es`
25-
- `ramda`
26-
- `antd`
27-
- `react-bootstrap`
28-
- `ahooks`
2922
- `@ant-design/icons`
30-
- `@headlessui/react`
3123
- `@headlessui-float/react`
24+
- `@headlessui/react`
3225
- `@heroicons/react/20/solid`
33-
- `@heroicons/react/24/solid`
3426
- `@heroicons/react/24/outline`
35-
- `@visx/visx`
36-
- `@tremor/react`
37-
- `rxjs`
38-
- `@mui/material`
39-
- `@mui/icons-material`
40-
- `recharts`
41-
- `react-use`
27+
- `@heroicons/react/24/solid`
4228
- `@material-ui/core`
4329
- `@material-ui/icons`
30+
- `@mui/icons-material`
31+
- `@mui/material`
32+
- `@phosphor-icons/react`
4433
- `@tabler/icons-react`
34+
- `@tremor/react`
35+
- `@visx/visx`
36+
- `ahooks`
37+
- `antd`
38+
- `date-fns`
39+
- `lodash-es`
40+
- `lucide-react`
4541
- `mui-core`
42+
- `ramda`
43+
- `react-bootstrap`
4644
- `react-icons/*`
45+
- `react-use`
46+
- `recharts`
47+
- `rxjs`

Diff for: packages/next/src/server/config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,7 @@ function assignDefaults(
10131013
'@effect/opentelemetry',
10141014
'@material-ui/core',
10151015
'@material-ui/icons',
1016+
'@phosphor-icons/react',
10161017
'@tabler/icons-react',
10171018
'mui-core',
10181019
// We don't support wildcard imports for these configs, e.g. `react-icons/*`

Diff for: test/development/basic/barrel-optimization/barrel-optimization.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { nextTestSetup } from 'e2e-utils'
1616
'@heroicons/react': '2.0.18',
1717
'@visx/visx': '3.3.0',
1818
'recursive-barrel': '1.0.0',
19+
'@phosphor-icons/react': '2.1.7',
1920
},
2021
})
2122

@@ -115,6 +116,11 @@ import { nextTestSetup } from 'e2e-utils'
115116
expect(html).toContain('<linearGradient')
116117
})
117118

119+
it('should support @phosphor-icons/react', async () => {
120+
const html = await next.render('/phosphor-icons')
121+
expect(html).toContain('<svg xmlns="http://www.w3.org/2000/svg"')
122+
})
123+
118124
it('should not break "use client" directive in optimized packages', async () => {
119125
const html = await next.render('/client')
120126
expect(html).toContain('this is a client component')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Horse, Heart, Cube } from '@phosphor-icons/react'
2+
3+
export default function Page() {
4+
return (
5+
<>
6+
<Horse />
7+
<Heart color="#AE2983" weight="fill" size={32} />
8+
<Cube color="teal" weight="duotone" />
9+
</>
10+
)
11+
}

0 commit comments

Comments
 (0)