(nitro: Nitro, options?: SentryNitroOptions, sentryEnabledSourcemaps?: boolean)
| 7 | * Registers a `compiled` hook to upload source maps after the build completes. |
| 8 | */ |
| 9 | export 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. |
no test coverage detected