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