@@ -43,18 +43,6 @@ type SourceMapsUploadOptions = {
43
43
*/
44
44
project ?: string ;
45
45
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
-
58
46
/**
59
47
* If this flag is `true`, the Sentry plugin will collect some telemetry data and send it to Sentry.
60
48
* It will not collect any sensitive or user-specific data.
@@ -63,6 +51,43 @@ type SourceMapsUploadOptions = {
63
51
*/
64
52
telemetry ?: boolean ;
65
53
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
+
66
91
/**
67
92
* Options related to managing the Sentry releases for a build.
68
93
*
@@ -171,12 +196,15 @@ export async function sentrySvelteKit(options: SentrySvelteKitPluginOptions = {}
171
196
}
172
197
173
198
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
+
177
204
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
+ } ) ;
180
208
sentryPlugins . push ( ...sentryVitePlugins ) ;
181
209
}
182
210
0 commit comments