-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathconfig.ts
More file actions
32 lines (27 loc) · 921 Bytes
/
config.ts
File metadata and controls
32 lines (27 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import type { NitroConfig } from 'nitro/types';
import { createNitroModule } from './module';
type SentryNitroOptions = {
// TODO: Add options
};
/**
* Modifies the passed in Nitro configuration with automatic build-time instrumentation.
*
* @param config A Nitro configuration object, as usually exported in `nitro.config.ts` or `nitro.config.mjs`.
* @returns The modified config to be exported
*/
export function withSentryConfig(config: NitroConfig, moduleOptions?: SentryNitroOptions): NitroConfig {
setupSentryNitroModule(config, moduleOptions);
return config;
}
/**
* Sets up the Sentry Nitro module, useful for meta framework integrations.
*/
export function setupSentryNitroModule(
config: NitroConfig,
_moduleOptions?: SentryNitroOptions,
_serverConfigFile?: string,
): NitroConfig {
config.modules = config.modules || [];
config.modules.push(createNitroModule());
return config;
}