MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / setupSourceMaps

Function setupSourceMaps

packages/nitro/src/sourceMaps.ts:9–19  ·  view source on GitHub ↗
(nitro: Nitro, options?: SentryNitroOptions, sentryEnabledSourcemaps?: boolean)

Source from the content-addressed store, hash-verified

7 * Registers a `compiled` hook to upload source maps after the build completes.
8 */
9export function setupSourceMaps(nitro: Nitro, options?: SentryNitroOptions, sentryEnabledSourcemaps?: boolean): void {
10 // The `compiled` hook fires on EVERY rebuild during `nitro dev` watch mode.
11 // nitro.options.dev is reliably set by the time module setup runs.
12 if (shouldSkipSourcemapUpload(nitro, options)) {
13 return;
14 }
15
16 nitro.hooks.hook('compiled', async (_nitro: Nitro) => {
17 await handleSourceMapUpload(_nitro, options, sentryEnabledSourcemaps);
18 });
19}
20
21/**
22 * Determines if sourcemap uploads should be skipped.

Callers 2

sourceMaps.test.tsFile · 0.90
createNitroModuleFunction · 0.90

Calls 2

handleSourceMapUploadFunction · 0.85

Tested by

no test coverage detected