@@ -43,18 +43,6 @@ type SourceMapsUploadOptions = {
4343 */
4444 project ?: string ;
4545
46- /**
47- * A glob or an array of globs that specify the build artifacts and source maps that will uploaded to Sentry.
48- *
49- * If this option is not specified, sensible defaults based on your adapter and svelte.config.js
50- * setup will be used. Use this option to override these defaults, for instance if you have a
51- * customized build setup that diverges from SvelteKit's defaults.
52- *
53- * The globbing patterns must follow the implementation of the `glob` package.
54- * @see https://www.npmjs.com/package/glob#glob-primer
55- */
56- assets ?: string | Array < string > ;
57-
5846 /**
5947 * If this flag is `true`, the Sentry plugin will collect some telemetry data and send it to Sentry.
6048 * It will not collect any sensitive or user-specific data.
@@ -63,6 +51,43 @@ type SourceMapsUploadOptions = {
6351 */
6452 telemetry ?: boolean ;
6553
54+ /**
55+ * Options related to sourcemaps
56+ */
57+ sourcemaps ?: {
58+ /**
59+ * A glob or an array of globs that specify the build artifacts and source maps that will be uploaded to Sentry.
60+ *
61+ * If this option is not specified, sensible defaults based on your adapter and svelte.config.js
62+ * setup will be used. Use this option to override these defaults, for instance if you have a
63+ * customized build setup that diverges from SvelteKit's defaults.
64+ *
65+ * The globbing patterns must follow the implementation of the `glob` package.
66+ * @see https://www.npmjs.com/package/glob#glob-primer
67+ */
68+ assets ?: string | Array < string > ;
69+
70+ /**
71+ * A glob or an array of globs that specifies which build artifacts should not be uploaded to Sentry.
72+ *
73+ * @default [] - By default no files are ignored. Thus, all files matching the `assets` glob
74+ * or the default value for `assets` are uploaded.
75+ *
76+ * The globbing patterns follow the implementation of the glob package. (https://www.npmjs.com/package/glob)
77+ */
78+ ignore ?: string | Array < string > ;
79+
80+ /**
81+ * A glob or an array of globs that specifies the build artifacts that should be deleted after the artifact
82+ * upload to Sentry has been completed.
83+ *
84+ * @default [] - By default no files are deleted.
85+ *
86+ * The globbing patterns follow the implementation of the glob package. (https://www.npmjs.com/package/glob)
87+ */
88+ filesToDeleteAfterUpload ?: string | Array < string > ;
89+ } ;
90+
6691 /**
6792 * Options related to managing the Sentry releases for a build.
6893 *
@@ -171,12 +196,15 @@ export async function sentrySvelteKit(options: SentrySvelteKitPluginOptions = {}
171196 }
172197
173198 if ( mergedOptions . autoUploadSourceMaps && process . env . NODE_ENV !== 'development' ) {
174- const pluginOptions = {
175- ...mergedOptions . sourceMapsUploadOptions ,
176- debug : mergedOptions . debug , // override the plugin's debug flag with the one from the top-level options
199+ const sourceMapsUploadOptions = mergedOptions . sourceMapsUploadOptions ;
200+
201+ const sentryVitePlugins = await makeCustomSentryVitePlugins ( {
202+ ...sourceMapsUploadOptions ,
203+
177204 adapter : mergedOptions . adapter ,
178- } ;
179- const sentryVitePlugins = await makeCustomSentryVitePlugins ( pluginOptions ) ;
205+ // override the plugin's debug flag with the one from the top-level options
206+ debug : mergedOptions . debug ,
207+ } ) ;
180208 sentryPlugins . push ( ...sentryVitePlugins ) ;
181209 }
182210
0 commit comments