transpilePackages
Next.js 可以自动转译和打包本地包(如 Monorepo)或外部依赖项(node_modules)中的依赖项。这取代了 next-transpile-modules 包。
next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ['package-name'],
}
module.exports = nextConfig版本历史
| 版本 | 更改 |
|---|---|
v13.0.0 | transpilePackages 已添加。 |
这有帮助吗?