-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add disableInstrumentation option to next.config.js
Add `disableInstrumentation` configuration option to control environment-specific instrumentation. * **Configuration Changes** - Add `disableInstrumentation` to the `NextConfig` type definition in `packages/next/src/server/config-shared.ts`. - Add `disableInstrumentation` to the `defaultConfig` object in `packages/next/src/server/config-shared.ts` with a default value of `false`. - Add logic to handle the `disableInstrumentation` option in the `assignDefaults` function in `packages/next/src/server/config.ts`. * **Instrumentation Control** - Add a check for the `disableInstrumentation` option in the `runInstrumentationHookIfAvailable` function in `packages/next/src/server/next-server.ts`. - Skip the instrumentation registration if `disableInstrumentation` is `true` in `packages/next/src/server/next-server.ts`. * **Example** - Add an example of using the `disableInstrumentation` option in the `next.config.js` file in `examples/basic-app/next.config.js`.
- Loading branch information
1 parent
2c1f68e
commit e87c74d
Showing
4 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
disableInstrumentation: process.env.NODE_ENV !== 'production' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters