本页还没有译文
本页 6 段还没译成简体中文,下面显示的是英文原文。optimizePackageImports
还没翻译译自英文(nextjs.org)本页 6 段都还没译
Some packages can export hundreds or thousands of modules, which can cause performance issues in development and production.
Adding a package to experimental.optimizePackageImports will only load the modules you are actually using, while still giving you the convenience of writing import statements with many named exports.
next.config.js
module.exports = {
experimental: {
optimizePackageImports: ['package-name'],
},
}The following libraries are optimized by default:
lucide-reactdate-fnslodash-esramdaantdreact-bootstrapahooks@ant-design/icons@headlessui/react@headlessui-float/react@heroicons/react/20/solid@heroicons/react/24/solid@heroicons/react/24/outline@visx/visx@tremor/reactrxjs@mui/material@mui/icons-materialrechartsreact-use@material-ui/core@material-ui/icons@tabler/icons-reactmui-corereact-icons/*effect@effect/*
AI 翻译查看英文原文