Files
next.js/test/e2e/instrumentation-hook/with-esm-import/instrumentation.js
Jiachi LiuandGitHub c9daf1fc8c Stablize instrumentation.js (#68853)
### What

- After adding a new API `onRequestError()` and a few fixes on `register()` for `instrumentation.js`, it's time to promote it as stable API.
- Add warning `"experimental.instrumentationHook is no longer needed to be configured in Next.js"` when you configure a `instrumentationHook` option in next.config.js

Related PRs
#67539, #67671, #67703, #67848, #67859, #67856, #67805, #68616, #68672, #68764, #68845 #68976, #68983

Closes NDX-89
2024-08-21 15:55:26 +02:00

8 lines
210 B
JavaScript

import * as mod from 'my-lib'
export function register() {
console.log('register in instrumentation.js is running')
// make sure that this is not tree-shaken
if (process.env.DOESNT_EXIST_1234) mod.c()
}