Skip to content

Commit

Permalink
add nextra/components to experimental.optimizePackageImports
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Oct 3, 2024
1 parent cba20a8 commit 0d1ea56
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/empty-parrots-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'nextra': patch
---

add `nextra/components` to `experimental.optimizePackageImports`
17 changes: 7 additions & 10 deletions packages/nextra/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,15 @@ const nextra: Nextra = nextraConfig => {
throw new Error('No Nextra theme found!')
}

// const optimizedImports = new Set(
// nextConfig.experimental?.optimizePackageImports || []
// )
//
// optimizedImports.add('nextra/components')

return {
...nextConfig,
// experimental: {
// ...nextConfig.experimental,
// optimizePackageImports: [...optimizedImports]
// },
experimental: {
...nextConfig.experimental,
optimizePackageImports: [
...(nextConfig.experimental?.optimizePackageImports || []),
'nextra/components'
]
},
...(nextConfig.output !== 'export' && { rewrites }),
env: {
...nextConfig.env,
Expand Down

0 comments on commit 0d1ea56

Please sign in to comment.