|
| 1 | +import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; |
| 2 | + |
| 3 | +type SourceMapsOptions = { |
| 4 | + /** |
| 5 | + * If this flag is `true`, and an auth token is detected, the Sentry SDK will |
| 6 | + * automatically generate and upload source maps to Sentry during a production build. |
| 7 | + * |
| 8 | + * @default true |
| 9 | + */ |
| 10 | + enabled?: boolean; |
| 11 | + |
| 12 | + /** |
| 13 | + * If this flag is `true`, the Sentry plugin will collect some telemetry data and send it to Sentry. |
| 14 | + * It will not collect any sensitive or user-specific data. |
| 15 | + * |
| 16 | + * @default true |
| 17 | + */ |
| 18 | + telemetry?: boolean; |
| 19 | + |
| 20 | + /** |
| 21 | + * A glob or an array of globs that specifies the build artifacts that should be deleted after the artifact |
| 22 | + * upload to Sentry has been completed. |
| 23 | + * |
| 24 | + * @default [] - By default no files are deleted. |
| 25 | + * |
| 26 | + * The globbing patterns follow the implementation of the glob package. (https://www.npmjs.com/package/glob) |
| 27 | + */ |
| 28 | + filesToDeleteAfterUpload?: string | Array<string>; |
| 29 | +}; |
| 30 | + |
| 31 | +type BundleSizeOptimizationOptions = { |
| 32 | + /** |
| 33 | + * If set to `true`, the plugin will attempt to tree-shake (remove) any debugging code within the Sentry SDK. |
| 34 | + * Note that the success of this depends on tree shaking being enabled in your build tooling. |
| 35 | + * |
| 36 | + * Setting this option to `true` will disable features like the SDK's `debug` option. |
| 37 | + */ |
| 38 | + excludeDebugStatements?: boolean; |
| 39 | + |
| 40 | + /** |
| 41 | + * If set to true, the plugin will try to tree-shake tracing statements out. |
| 42 | + * Note that the success of this depends on tree shaking generally being enabled in your build. |
| 43 | + * Attention: DO NOT enable this when you're using any performance monitoring-related SDK features (e.g. Sentry.startSpan()). |
| 44 | + */ |
| 45 | + excludeTracing?: boolean; |
| 46 | + |
| 47 | + /** |
| 48 | + * If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay Shadow DOM recording functionality. |
| 49 | + * Note that the success of this depends on tree shaking being enabled in your build tooling. |
| 50 | + * |
| 51 | + * This option is safe to be used when you do not want to capture any Shadow DOM activity via Sentry Session Replay. |
| 52 | + */ |
| 53 | + excludeReplayShadowDom?: boolean; |
| 54 | + |
| 55 | + /** |
| 56 | + * If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay `iframe` recording functionality. |
| 57 | + * Note that the success of this depends on tree shaking being enabled in your build tooling. |
| 58 | + * |
| 59 | + * You can safely do this when you do not want to capture any `iframe` activity via Sentry Session Replay. |
| 60 | + */ |
| 61 | + excludeReplayIframe?: boolean; |
| 62 | + |
| 63 | + /** |
| 64 | + * If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay's Compression Web Worker. |
| 65 | + * Note that the success of this depends on tree shaking being enabled in your build tooling. |
| 66 | + * |
| 67 | + * **Notice:** You should only do use this option if you manually host a compression worker and configure it in your Sentry Session Replay integration config via the `workerUrl` option. |
| 68 | + */ |
| 69 | + excludeReplayWorker?: boolean; |
| 70 | +}; |
| 71 | + |
| 72 | +export type SentryReactRouterPluginOptions = { |
| 73 | + /** |
| 74 | + * The auth token to use when uploading source maps to Sentry. |
| 75 | + * |
| 76 | + * Instead of specifying this option, you can also set the `SENTRY_AUTH_TOKEN` environment variable. |
| 77 | + * |
| 78 | + * To create an auth token, follow this guide: |
| 79 | + * @see https://docs.sentry.io/product/accounts/auth-tokens/#organization-auth-tokens |
| 80 | + */ |
| 81 | + authToken?: string; |
| 82 | + |
| 83 | + /** |
| 84 | + * The organization slug of your Sentry organization. |
| 85 | + * Instead of specifying this option, you can also set the `SENTRY_ORG` environment variable. |
| 86 | + */ |
| 87 | + org?: string; |
| 88 | + |
| 89 | + /** |
| 90 | + * The project slug of your Sentry project. |
| 91 | + * Instead of specifying this option, you can also set the `SENTRY_PROJECT` environment variable. |
| 92 | + */ |
| 93 | + project?: string; |
| 94 | + |
| 95 | + /** |
| 96 | + * Options for the Sentry Vite plugin to customize bundle size optimizations. |
| 97 | + */ |
| 98 | + bundleSizeOptimizations?: BundleSizeOptimizationOptions; |
| 99 | + |
| 100 | + /** |
| 101 | + * If this flag is `true`, Sentry will log debug information during build time. |
| 102 | + * @default false. |
| 103 | + */ |
| 104 | + debug?: boolean; |
| 105 | + |
| 106 | + /** |
| 107 | + * Options for the Sentry Vite plugin to customize the source maps upload process. |
| 108 | + * |
| 109 | + */ |
| 110 | + sourceMapsUploadOptions?: SourceMapsOptions; |
| 111 | + |
| 112 | + /** |
| 113 | + * Options to further customize the Sentry Vite Plugin (@sentry/vite-plugin) behavior directly. |
| 114 | + * Options specified in this object take precedence over the options specified in |
| 115 | + * the `sourcemaps` and `release` objects. |
| 116 | + * |
| 117 | + * @see https://www.npmjs.com/package/@sentry/vite-plugin/v/2.22.2#options which lists all available options. |
| 118 | + * |
| 119 | + * Warning: Options within this object are subject to change at any time. |
| 120 | + * We DO NOT guarantee semantic versioning for these options, meaning breaking |
| 121 | + * changes can occur at any time within a major SDK version. |
| 122 | + * |
| 123 | + * Furthermore, some options are untested with SvelteKit specifically. Use with caution. |
| 124 | + */ |
| 125 | + unstable_sentryVitePluginOptions?: Partial<SentryVitePluginOptions>; |
| 126 | +}; |
0 commit comments