Unverified Commit f567aaf1 authored by Shu Ding's avatar Shu Ding Committed by GitHub

Add `@visx/visx` to the import optimization list (#54778)

Ref: https://unpkg.com/@visx/visx@3.3.0/lib/index.js.
parent a759711c
...@@ -732,6 +732,7 @@ function assignDefaults( ...@@ -732,6 +732,7 @@ function assignDefaults(
'@heroicons/react/20/solid', '@heroicons/react/20/solid',
'@heroicons/react/24/solid', '@heroicons/react/24/solid',
'@heroicons/react/24/outline', '@heroicons/react/24/outline',
'@visx/visx',
]), ]),
] ]
......
...@@ -38,6 +38,7 @@ describe('optimizePackageImports', () => { ...@@ -38,6 +38,7 @@ describe('optimizePackageImports', () => {
'lucide-react': '0.264.0', 'lucide-react': '0.264.0',
'@headlessui/react': '1.7.17', '@headlessui/react': '1.7.17',
'@heroicons/react': '2.0.18', '@heroicons/react': '2.0.18',
'@visx/visx': '3.3.0',
}, },
}) })
}) })
...@@ -117,4 +118,9 @@ describe('optimizePackageImports', () => { ...@@ -117,4 +118,9 @@ describe('optimizePackageImports', () => {
const html = await next.render('/recursive') const html = await next.render('/recursive')
expect(html).toContain('<h1>42</h1>') expect(html).toContain('<h1>42</h1>')
}) })
it('should support visx', async () => {
const html = await next.render('/visx')
expect(html).toContain('<linearGradient')
})
}) })
import { Gradient } from '@visx/visx'
export default function Page() {
return (
<svg width={400} height={400}>
<Gradient.GradientPinkBlue id="g" from="red" to="blue" />
<rect width={400} height={400} fill="url(#g)" />
</svg>
)
}
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