Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
f567aaf1
Unverified
Commit
f567aaf1
authored
Aug 30, 2023
by
Shu Ding
Committed by
GitHub
Aug 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `@visx/visx` to the import optimization list (#54778)
Ref:
https://unpkg.com/@visx/visx@3.3.0/lib/index.js
.
parent
a759711c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
config.ts
packages/next/src/server/config.ts
+1
-0
barrel-optimization.test.ts
test/development/basic/barrel-optimization.test.ts
+6
-0
visx.js
test/development/basic/barrel-optimization/pages/visx.js
+10
-0
No files found.
packages/next/src/server/config.ts
View file @
f567aaf1
...
@@ -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'
,
]),
]),
]
]
...
...
test/development/basic/barrel-optimization.test.ts
View file @
f567aaf1
...
@@ -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'
)
})
})
})
test/development/basic/barrel-optimization/pages/visx.js
0 → 100644
View file @
f567aaf1
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
>
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment