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

Function handleSourceMapUpload

packages/nitro/src/sourceMaps.ts:37–62  ·  view source on GitHub ↗

* Handles the actual source map upload after the build completes.

(
  nitro: Nitro,
  options?: SentryNitroOptions,
  sentryEnabledSourcemaps?: boolean,
)

Source from the content-addressed store, hash-verified

35 * Handles the actual source map upload after the build completes.
36 */
37async function handleSourceMapUpload(
38 nitro: Nitro,
39 options?: SentryNitroOptions,
40 sentryEnabledSourcemaps?: boolean,
41): Promise<void> {
42 const outputDir = nitro.options.output.serverDir;
43 const pluginOptions = getPluginOptions(options, sentryEnabledSourcemaps, outputDir);
44
45 const sentryBuildPluginManager = createSentryBuildPluginManager(pluginOptions, {
46 buildTool: 'nitro',
47 loggerPrefix: '[@sentry/nitro]',
48 });
49
50 await sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal();
51 await sentryBuildPluginManager.createRelease();
52
53 await sentryBuildPluginManager.injectDebugIds([outputDir]);
54
55 if (options?.sourcemaps?.disable !== 'disable-upload') {
56 await sentryBuildPluginManager.uploadSourcemaps([outputDir], {
57 // We don't prepare the artifacts because we injected debug IDs manually before
58 prepareArtifacts: false,
59 });
60 await sentryBuildPluginManager.deleteArtifacts();
61 }
62}
63
64/**
65 * Normalizes the beginning of a path from e.g. ../../../ to ./

Callers 1

setupSourceMapsFunction · 0.85

Calls 2

getPluginOptionsFunction · 0.70

Tested by

no test coverage detected