feat: convert components to dynamic imports for improved performance (#22614)

This commit is contained in:
Wu Tianwei 2025-07-18 11:43:37 +08:00 • committed by GitHub
commit b035f3f884
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 493 additions and 472 deletions

View file

@ -12,6 +12,9 @@ const withMDX = require('@next/mdx')({
// providerImportSource: "@mdx-js/react",
},
})
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
// the default url to prevent parse url error when running jest
const hasSetWebPrefix = process.env.NEXT_PUBLIC_WEB_PREFIX
@ -66,4 +69,4 @@ const nextConfig = {
output: 'standalone',
}
module.exports = withMDX(nextConfig)
module.exports = withBundleAnalyzer(withMDX(nextConfig))