





















请注意,本文编写于 787 天前,最后修改于 787 天前,其中某些信息可能已经过时。
在 Next.js 的 next.config.js 文件中开启 experimental.instrumentationHook 功能,然后在项目根目录创建 instrumentation.ts 文件,并在其中导出一个 register 函数。这个 register 函数会在 Next.js 服务启动时被执行。
// next.config.js const nextConfig = { experimental: { instrumentationHook: true, }, } module.exports = nextConfig
export async function register() { console.log("do something") }
本文作者:mereith
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。