@sentry/vite-plugin 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -56,27 +56,6 @@ export default defineConfig({
56
56
  // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
57
57
  // and need `project:releases` and `org:read` scopes
58
58
  authToken: process.env.SENTRY_AUTH_TOKEN,
59
-
60
- sourcemaps: {
61
- // Specify the directory containing build artifacts
62
- assets: "./**",
63
- // Don't upload the source maps of dependencies
64
- ignore: ["./node_modules/**"],
65
- },
66
-
67
- // Helps troubleshooting - set to false to make plugin less noisy
68
- debug: true,
69
-
70
- // Use the following option if you're on an SDK version lower than 7.47.0:
71
- // release: {
72
- // uploadLegacySourcemaps: {
73
- // include: ".",
74
- // ignore: ["node_modules"],
75
- // },
76
- // },
77
-
78
- // Optionally uncomment the line below to override automatic release name detection
79
- // release: env.RELEASE,
80
59
  }),
81
60
  ],
82
61
  });
@@ -113,17 +92,13 @@ export default defineConfig({
113
92
  - [`_experiments`](#option-_experiments)
114
93
  - [`injectBuildInformation`](#option-_experiments-injectbuildinformation)
115
94
 
116
- ### `org`
117
-
118
- <a name="option-org"></a>
95
+ ### <a name="option-org"></a>`org`
119
96
 
120
97
  Type: `string`
121
98
 
122
99
  The slug of the Sentry organization associated with the app.
123
100
 
124
- ### `project`
125
-
126
- <a name="option-project"></a>
101
+ ### <a name="option-project"></a>`project`
127
102
 
128
103
 
129
104
 
@@ -131,9 +106,7 @@ The slug of the Sentry project associated with the app.
131
106
 
132
107
  This value can also be specified via the `SENTRY_PROJECT` environment variable.
133
108
 
134
- ### `authToken`
135
-
136
- <a name="option-authtoken"></a>
109
+ ### <a name="option-authtoken"></a>`authToken`
137
110
 
138
111
  Type: `string`
139
112
 
@@ -141,9 +114,7 @@ The authentication token to use for all communication with Sentry. Can be obtain
141
114
 
142
115
  This value can also be specified via the `SENTRY_AUTH_TOKEN` environment variable.
143
116
 
144
- ### `url`
145
-
146
- <a name="option-url"></a>
117
+ ### <a name="option-url"></a>`url`
147
118
 
148
119
  Type: `string`
149
120
 
@@ -153,33 +124,25 @@ This value can also be set via the SENTRY_URL environment variable.
153
124
 
154
125
  Defaults to https://sentry.io/, which is the correct value for SaaS customers.
155
126
 
156
- ### `headers`
157
-
158
- <a name="option-headers"></a>
127
+ ### <a name="option-headers"></a>`headers`
159
128
 
160
129
  Type: `Record<string, string>`
161
130
 
162
131
  Headers added to every outgoing network request.
163
132
 
164
- ### `debug`
165
-
166
- <a name="option-debug"></a>
133
+ ### <a name="option-debug"></a>`debug`
167
134
 
168
135
  Type: `boolean`
169
136
 
170
137
  Print useful debug information. Defaults to `false`.
171
138
 
172
- ### `silent`
173
-
174
- <a name="option-silent"></a>
139
+ ### <a name="option-silent"></a>`silent`
175
140
 
176
141
  Type: `boolean`
177
142
 
178
143
  Suppresses all logs. Defaults to `false`.
179
144
 
180
- ### `errorHandler`
181
-
182
- <a name="option-errorhandler"></a>
145
+ ### <a name="option-errorhandler"></a>`errorHandler`
183
146
 
184
147
  Type: `(err: Error) => void`
185
148
 
@@ -196,9 +159,7 @@ errorHandler: (err) => {
196
159
  ```
197
160
 
198
161
 
199
- ### `telemetry`
200
-
201
- <a name="option-telemetry"></a>
162
+ ### <a name="option-telemetry"></a>`telemetry`
202
163
 
203
164
  Type: `boolean`
204
165
 
@@ -208,36 +169,30 @@ At Sentry we like to use Sentry ourselves to deliver faster and more stable prod
208
169
 
209
170
  Defaults to `true`.
210
171
 
211
- ### `disable`
212
-
213
- <a name="option-disable"></a>
172
+ ### <a name="option-disable"></a>`disable`
214
173
 
215
174
  Type: `boolean`
216
175
 
217
176
  Completely disables all functionality of the plugin. Defaults to `false`.
218
177
 
219
- ### `sourcemaps`
220
-
221
- <a name="option-sourcemaps"></a>
178
+ ### <a name="option-sourcemaps"></a>`sourcemaps`
222
179
 
223
180
 
224
181
 
225
182
  Options for source maps uploading. Leave this option undefined if you do not want to upload source maps to Sentry.
226
- ### `sourcemaps.assets`
227
-
228
- <a name="option-sourcemaps-assets"></a>
183
+ ### <a name="option-sourcemaps-assets"></a>`sourcemaps.assets`
229
184
 
230
185
  Type: `string | string[]`
231
186
 
232
187
  A glob or an array of globs that specifies the build artifacts that should be uploaded to Sentry.
233
188
 
189
+ If this option is not specified, the plugin will try to upload all JavaScript files and source map files that are created during build.
190
+
234
191
  The globbing patterns follow the implementation of the `glob` package. (https://www.npmjs.com/package/glob)
235
192
 
236
193
  Use the `debug` option to print information about which files end up being uploaded.
237
194
 
238
- ### `sourcemaps.ignore`
239
-
240
- <a name="option-sourcemaps-ignore"></a>
195
+ ### <a name="option-sourcemaps-ignore"></a>`sourcemaps.ignore`
241
196
 
242
197
  Type: `string | string[]`
243
198
 
@@ -249,9 +204,7 @@ The globbing patterns follow the implementation of the `glob` package. (https://
249
204
 
250
205
  Use the `debug` option to print information about which files end up being uploaded.
251
206
 
252
- ### `sourcemaps.rewriteSources`
253
-
254
- <a name="option-sourcemaps-rewritesources"></a>
207
+ ### <a name="option-sourcemaps-rewritesources"></a>`sourcemaps.rewriteSources`
255
208
 
256
209
  Type: `(source: string, map: any) => string`
257
210
 
@@ -259,9 +212,7 @@ Hook to rewrite the `sources` field inside the source map before being uploaded
259
212
 
260
213
  Defaults to making all sources relative to `process.cwd()` while building.
261
214
 
262
- ### `sourcemaps.deleteFilesAfterUpload`
263
-
264
- <a name="option-sourcemaps-deletefilesafterupload"></a>
215
+ ### <a name="option-sourcemaps-deletefilesafterupload"></a>`sourcemaps.deleteFilesAfterUpload`
265
216
 
266
217
  Type: `string | string[]`
267
218
 
@@ -271,18 +222,14 @@ The globbing patterns follow the implementation of the `glob` package. (https://
271
222
 
272
223
  Use the `debug` option to print information about which files end up being deleted.
273
224
 
274
- ### `release`
275
-
276
- <a name="option-release"></a>
225
+ ### <a name="option-release"></a>`release`
277
226
 
278
227
 
279
228
 
280
229
  Options related to managing the Sentry releases for a build.
281
230
 
282
231
  More info: https://docs.sentry.io/product/releases/
283
- ### `release.name`
284
-
285
- <a name="option-release-name"></a>
232
+ ### <a name="option-release-name"></a>`release.name`
286
233
 
287
234
  Type: `string`
288
235
 
@@ -294,9 +241,7 @@ Defaults to automatically detecting a value for your environment. This includes
294
241
 
295
242
  If you didn't provide a value and the plugin can't automatically detect one, no release will be created.
296
243
 
297
- ### `release.inject`
298
-
299
- <a name="option-release-inject"></a>
244
+ ### <a name="option-release-inject"></a>`release.inject`
300
245
 
301
246
  Type: `boolean`
302
247
 
@@ -304,9 +249,7 @@ Whether the plugin should inject release information into the build for the SDK
304
249
 
305
250
  Defaults to `true`.
306
251
 
307
- ### `release.create`
308
-
309
- <a name="option-release-create"></a>
252
+ ### <a name="option-release-create"></a>`release.create`
310
253
 
311
254
  Type: `boolean`
312
255
 
@@ -314,9 +257,7 @@ Whether the plugin should create a release on Sentry during the build. Note that
314
257
 
315
258
  Defaults to `true`.
316
259
 
317
- ### `release.finalize`
318
-
319
- <a name="option-release-finalize"></a>
260
+ ### <a name="option-release-finalize"></a>`release.finalize`
320
261
 
321
262
  Type: `boolean`
322
263
 
@@ -324,17 +265,13 @@ Whether the Sentry release should be automatically finalized (meaning an end tim
324
265
 
325
266
  Defaults to `true`.
326
267
 
327
- ### `release.dist`
328
-
329
- <a name="option-release-dist"></a>
268
+ ### <a name="option-release-dist"></a>`release.dist`
330
269
 
331
270
  Type: `string`
332
271
 
333
272
  Unique identifier for the distribution, used to further segment your release.
334
273
 
335
- ### `release.vcsRemote`
336
-
337
- <a name="option-release-vcsremote"></a>
274
+ ### <a name="option-release-vcsremote"></a>`release.vcsRemote`
338
275
 
339
276
  Type: `string`
340
277
 
@@ -344,16 +281,12 @@ This value can also be specified via the `SENTRY_VSC_REMOTE` environment variabl
344
281
 
345
282
  Defaults to 'origin'.
346
283
 
347
- ### `release.setCommits`
348
-
349
- <a name="option-release-setcommits"></a>
284
+ ### <a name="option-release-setcommits"></a>`release.setCommits`
350
285
 
351
286
 
352
287
 
353
288
  Option to associate the created release with its commits in Sentry.
354
- ### `release.setCommits.previousCommit`
355
-
356
- <a name="option-release-setcommits-previouscommit"></a>
289
+ ### <a name="option-release-setcommits-previouscommit"></a>`release.setCommits.previousCommit`
357
290
 
358
291
  Type: `string`
359
292
 
@@ -363,9 +296,7 @@ Defaults to the last commit of the previous release in Sentry.
363
296
 
364
297
  If there was no previous release, the last 10 commits will be used.
365
298
 
366
- ### `release.setCommits.ignoreMissing`
367
-
368
- <a name="option-release-setcommits-ignoremissing"></a>
299
+ ### <a name="option-release-setcommits-ignoremissing"></a>`release.setCommits.ignoreMissing`
369
300
 
370
301
  Type: `boolean`
371
302
 
@@ -373,9 +304,7 @@ If the flag is to `true` and the previous release commit was not found in the re
373
304
 
374
305
  Defaults to `false`.
375
306
 
376
- ### `release.setCommits.ignoreEmpty`
377
-
378
- <a name="option-release-setcommits-ignoreempty"></a>
307
+ ### <a name="option-release-setcommits-ignoreempty"></a>`release.setCommits.ignoreEmpty`
379
308
 
380
309
  Type: `boolean`
381
310
 
@@ -383,9 +312,7 @@ If this flag is set, the setCommits step will not fail and just exit silently if
383
312
 
384
313
  Defaults to `false`.
385
314
 
386
- ### `release.setCommits.auto`
387
-
388
- <a name="option-release-setcommits-auto"></a>
315
+ ### <a name="option-release-setcommits-auto"></a>`release.setCommits.auto`
389
316
 
390
317
  Type: `boolean`
391
318
 
@@ -393,9 +320,7 @@ Automatically sets `commit` and `previousCommit`. Sets `commit` to `HEAD` and `p
393
320
 
394
321
  If you set this to `true`, manually specified `commit` and `previousCommit` options will be overridden. It is best to not specify them at all if you set this option to `true`.
395
322
 
396
- ### `release.setCommits.repo`
397
-
398
- <a name="option-release-setcommits-repo"></a>
323
+ ### <a name="option-release-setcommits-repo"></a>`release.setCommits.repo`
399
324
 
400
325
  Type: `string`
401
326
 
@@ -403,9 +328,7 @@ The full repo name as defined in Sentry.
403
328
 
404
329
  Required if the `auto` option is not set to `true`.
405
330
 
406
- ### `release.setCommits.commit`
407
-
408
- <a name="option-release-setcommits-commit"></a>
331
+ ### <a name="option-release-setcommits-commit"></a>`release.setCommits.commit`
409
332
 
410
333
  Type: `string`
411
334
 
@@ -413,64 +336,48 @@ The current (last) commit in the release.
413
336
 
414
337
  Required if the `auto` option is not set to `true`.
415
338
 
416
- ### `release.deploy`
417
-
418
- <a name="option-release-deploy"></a>
339
+ ### <a name="option-release-deploy"></a>`release.deploy`
419
340
 
420
341
 
421
342
 
422
343
  Adds deployment information to the release in Sentry.
423
- ### `release.deploy.env`
424
-
425
- <a name="option-release-deploy-env"></a>
344
+ ### <a name="option-release-deploy-env"></a>`release.deploy.env`
426
345
 
427
346
  Type: `string`
428
347
 
429
348
  Environment for this release. Values that make sense here would be `production` or `staging`.
430
349
 
431
- ### `release.deploy.started`
432
-
433
- <a name="option-release-deploy-started"></a>
350
+ ### <a name="option-release-deploy-started"></a>`release.deploy.started`
434
351
 
435
352
  Type: `number | string`
436
353
 
437
354
  Deployment start time in Unix timestamp (in seconds) or ISO 8601 format.
438
355
 
439
- ### `release.deploy.finished`
440
-
441
- <a name="option-release-deploy-finished"></a>
356
+ ### <a name="option-release-deploy-finished"></a>`release.deploy.finished`
442
357
 
443
358
  Type: `number | string`
444
359
 
445
360
  Deployment finish time in Unix timestamp (in seconds) or ISO 8601 format.
446
361
 
447
- ### `release.deploy.time`
448
-
449
- <a name="option-release-deploy-time"></a>
362
+ ### <a name="option-release-deploy-time"></a>`release.deploy.time`
450
363
 
451
364
  Type: `number`
452
365
 
453
366
  Deployment duration (in seconds). Can be used instead of started and finished.
454
367
 
455
- ### `release.deploy.name`
456
-
457
- <a name="option-release-deploy-name"></a>
368
+ ### <a name="option-release-deploy-name"></a>`release.deploy.name`
458
369
 
459
370
  Type: `string`
460
371
 
461
372
  Human readable name for the deployment.
462
373
 
463
- ### `release.deploy.url`
464
-
465
- <a name="option-release-deploy-url"></a>
374
+ ### <a name="option-release-deploy-url"></a>`release.deploy.url`
466
375
 
467
376
  Type: `string`
468
377
 
469
378
  URL that points to the deployment.
470
379
 
471
- ### `release.cleanArtifacts`
472
-
473
- <a name="option-release-cleanartifacts"></a>
380
+ ### <a name="option-release-cleanartifacts"></a>`release.cleanArtifacts`
474
381
 
475
382
  Type: `boolean`
476
383
 
@@ -478,9 +385,7 @@ Remove all previously uploaded artifacts for this release on Sentry before the u
478
385
 
479
386
  Defaults to `false`.
480
387
 
481
- ### `release.uploadLegacySourcemaps`
482
-
483
- <a name="option-release-uploadlegacysourcemaps"></a>
388
+ ### <a name="option-release-uploadlegacysourcemaps"></a>`release.uploadLegacySourcemaps`
484
389
 
485
390
  Type: `string | IncludeEntry | Array<string | IncludeEntry>`
486
391
 
@@ -580,16 +485,12 @@ type IncludeEntry = {
580
485
 
581
486
 
582
487
 
583
- ### `_experiments`
584
-
585
- <a name="option-_experiments"></a>
488
+ ### <a name="option-_experiments"></a>`_experiments`
586
489
 
587
490
  Type: `string`
588
491
 
589
492
  Options that are considered experimental and subject to change. This option does not follow semantic versioning and may change in any release.
590
- ### `_experiments.injectBuildInformation`
591
-
592
- <a name="option-_experiments-injectbuildinformation"></a>
493
+ ### <a name="option-_experiments-injectbuildinformation"></a>`_experiments.injectBuildInformation`
593
494
 
594
495
  Type: `boolean`
595
496
 
package/dist/cjs/index.js CHANGED
@@ -12,19 +12,25 @@ function viteReleaseInjectionPlugin(injectionCode) {
12
12
  vite: bundlerPluginCore.createRollupReleaseInjectionHooks(injectionCode)
13
13
  };
14
14
  }
15
-
16
15
  function viteDebugIdInjectionPlugin() {
17
16
  return {
18
17
  name: "sentry-vite-debug-id-injection-plugin",
19
18
  vite: bundlerPluginCore.createRollupDebugIdInjectionHooks()
20
19
  };
21
20
  }
22
-
21
+ function viteDebugIdUploadPlugin(upload) {
22
+ return {
23
+ name: "sentry-vite-debug-id-upload-plugin",
24
+ vite: bundlerPluginCore.createRollupDebugIdUploadHooks(upload)
25
+ };
26
+ }
23
27
  var sentryUnplugin = bundlerPluginCore.sentryUnpluginFactory({
24
28
  releaseInjectionPlugin: viteReleaseInjectionPlugin,
25
- debugIdInjectionPlugin: viteDebugIdInjectionPlugin
26
- }); // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ debugIdInjectionPlugin: viteDebugIdInjectionPlugin,
30
+ debugIdUploadPlugin: viteDebugIdUploadPlugin
31
+ });
27
32
 
33
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
34
  var sentryVitePlugin = sentryUnplugin.vite;
29
35
 
30
36
  Object.defineProperty(exports, 'sentryCliBinaryExists', {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n sentryUnpluginFactory,\n Options,\n createRollupReleaseInjectionHooks,\n createRollupDebugIdInjectionHooks,\n} from \"@sentry/bundler-plugin-core\";\nimport { UnpluginOptions } from \"unplugin\";\n\nfunction viteReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-vite-release-injection-plugin\",\n enforce: \"pre\" as const, // need this so that vite runs the resolveId hook\n vite: createRollupReleaseInjectionHooks(injectionCode),\n };\n}\n\nfunction viteDebugIdInjectionPlugin(): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-injection-plugin\",\n vite: createRollupDebugIdInjectionHooks(),\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: viteReleaseInjectionPlugin,\n debugIdInjectionPlugin: viteDebugIdInjectionPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryVitePlugin: (options: Options) => any = sentryUnplugin.vite;\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["viteReleaseInjectionPlugin","injectionCode","name","enforce","vite","createRollupReleaseInjectionHooks","viteDebugIdInjectionPlugin","createRollupDebugIdInjectionHooks","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","debugIdInjectionPlugin","sentryVitePlugin"],"mappings":";;;;;;AAQA,SAASA,0BAAT,CAAoCC,aAApC,EAA4E;EAC1E,OAAO;AACLC,IAAAA,IAAI,EAAE,sCADD;AAELC,IAAAA,OAAO,EAAE,KAFJ;AAEoB;IACzBC,IAAI,EAAEC,mDAAiC,CAACJ,aAAD,CAAA;GAHzC,CAAA;AAKD,CAAA;;AAED,SAASK,0BAAT,GAAuD;EACrD,OAAO;AACLJ,IAAAA,IAAI,EAAE,uCADD;AAELE,IAAAA,IAAI,EAAEG,mDAAiC,EAAA;GAFzC,CAAA;AAID,CAAA;;AAED,IAAMC,cAAc,GAAGC,uCAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAEV,0BADmB;AAE3CW,EAAAA,sBAAsB,EAAEL,0BAAAA;AAFmB,CAAD,CAA5C;;AAMaM,IAAAA,gBAA2C,GAAGJ,cAAc,CAACJ;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n sentryUnpluginFactory,\n Options,\n createRollupReleaseInjectionHooks,\n createRollupDebugIdInjectionHooks,\n createRollupDebugIdUploadHooks,\n} from \"@sentry/bundler-plugin-core\";\nimport { UnpluginOptions } from \"unplugin\";\n\nfunction viteReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-vite-release-injection-plugin\",\n enforce: \"pre\" as const, // need this so that vite runs the resolveId hook\n vite: createRollupReleaseInjectionHooks(injectionCode),\n };\n}\n\nfunction viteDebugIdInjectionPlugin(): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-injection-plugin\",\n vite: createRollupDebugIdInjectionHooks(),\n };\n}\n\nfunction viteDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-upload-plugin\",\n vite: createRollupDebugIdUploadHooks(upload),\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: viteReleaseInjectionPlugin,\n debugIdInjectionPlugin: viteDebugIdInjectionPlugin,\n debugIdUploadPlugin: viteDebugIdUploadPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryVitePlugin: (options: Options) => any = sentryUnplugin.vite;\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["viteReleaseInjectionPlugin","injectionCode","name","enforce","vite","createRollupReleaseInjectionHooks","viteDebugIdInjectionPlugin","createRollupDebugIdInjectionHooks","viteDebugIdUploadPlugin","upload","createRollupDebugIdUploadHooks","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","debugIdInjectionPlugin","debugIdUploadPlugin","sentryVitePlugin"],"mappings":";;;;;;AASA,SAASA,0BAA0BA,CAACC,aAAqB,EAAmB;EAC1E,OAAO;AACLC,IAAAA,IAAI,EAAE,sCAAsC;AAC5CC,IAAAA,OAAO,EAAE,KAAc;AAAE;IACzBC,IAAI,EAAEC,mDAAiC,CAACJ,aAAa,CAAA;GACtD,CAAA;AACH,CAAA;AAEA,SAASK,0BAA0BA,GAAoB;EACrD,OAAO;AACLJ,IAAAA,IAAI,EAAE,uCAAuC;IAC7CE,IAAI,EAAEG,mDAAiC,EAAC;GACzC,CAAA;AACH,CAAA;AAEA,SAASC,uBAAuBA,CAC9BC,MAAmD,EAClC;EACjB,OAAO;AACLP,IAAAA,IAAI,EAAE,oCAAoC;IAC1CE,IAAI,EAAEM,gDAA8B,CAACD,MAAM,CAAA;GAC5C,CAAA;AACH,CAAA;AAEA,IAAME,cAAc,GAAGC,uCAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAEb,0BAA0B;AAClDc,EAAAA,sBAAsB,EAAER,0BAA0B;AAClDS,EAAAA,mBAAmB,EAAEP,uBAAAA;AACvB,CAAC,CAAC,CAAA;;AAEF;AACaQ,IAAAA,gBAA2C,GAAGL,cAAc,CAACP;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { sentryUnpluginFactory, createRollupReleaseInjectionHooks, createRollupDebugIdInjectionHooks } from '@sentry/bundler-plugin-core';
1
+ import { sentryUnpluginFactory, createRollupReleaseInjectionHooks, createRollupDebugIdInjectionHooks, createRollupDebugIdUploadHooks } from '@sentry/bundler-plugin-core';
2
2
  export { sentryCliBinaryExists } from '@sentry/bundler-plugin-core';
3
3
 
4
4
  function viteReleaseInjectionPlugin(injectionCode) {
@@ -9,19 +9,25 @@ function viteReleaseInjectionPlugin(injectionCode) {
9
9
  vite: createRollupReleaseInjectionHooks(injectionCode)
10
10
  };
11
11
  }
12
-
13
12
  function viteDebugIdInjectionPlugin() {
14
13
  return {
15
14
  name: "sentry-vite-debug-id-injection-plugin",
16
15
  vite: createRollupDebugIdInjectionHooks()
17
16
  };
18
17
  }
19
-
18
+ function viteDebugIdUploadPlugin(upload) {
19
+ return {
20
+ name: "sentry-vite-debug-id-upload-plugin",
21
+ vite: createRollupDebugIdUploadHooks(upload)
22
+ };
23
+ }
20
24
  var sentryUnplugin = sentryUnpluginFactory({
21
25
  releaseInjectionPlugin: viteReleaseInjectionPlugin,
22
- debugIdInjectionPlugin: viteDebugIdInjectionPlugin
23
- }); // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
+ debugIdInjectionPlugin: viteDebugIdInjectionPlugin,
27
+ debugIdUploadPlugin: viteDebugIdUploadPlugin
28
+ });
24
29
 
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
31
  var sentryVitePlugin = sentryUnplugin.vite;
26
32
 
27
33
  export { sentryVitePlugin };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import {\n sentryUnpluginFactory,\n Options,\n createRollupReleaseInjectionHooks,\n createRollupDebugIdInjectionHooks,\n} from \"@sentry/bundler-plugin-core\";\nimport { UnpluginOptions } from \"unplugin\";\n\nfunction viteReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-vite-release-injection-plugin\",\n enforce: \"pre\" as const, // need this so that vite runs the resolveId hook\n vite: createRollupReleaseInjectionHooks(injectionCode),\n };\n}\n\nfunction viteDebugIdInjectionPlugin(): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-injection-plugin\",\n vite: createRollupDebugIdInjectionHooks(),\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: viteReleaseInjectionPlugin,\n debugIdInjectionPlugin: viteDebugIdInjectionPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryVitePlugin: (options: Options) => any = sentryUnplugin.vite;\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["viteReleaseInjectionPlugin","injectionCode","name","enforce","vite","createRollupReleaseInjectionHooks","viteDebugIdInjectionPlugin","createRollupDebugIdInjectionHooks","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","debugIdInjectionPlugin","sentryVitePlugin"],"mappings":";;;AAQA,SAASA,0BAAT,CAAoCC,aAApC,EAA4E;EAC1E,OAAO;AACLC,IAAAA,IAAI,EAAE,sCADD;AAELC,IAAAA,OAAO,EAAE,KAFJ;AAEoB;IACzBC,IAAI,EAAEC,iCAAiC,CAACJ,aAAD,CAAA;GAHzC,CAAA;AAKD,CAAA;;AAED,SAASK,0BAAT,GAAuD;EACrD,OAAO;AACLJ,IAAAA,IAAI,EAAE,uCADD;AAELE,IAAAA,IAAI,EAAEG,iCAAiC,EAAA;GAFzC,CAAA;AAID,CAAA;;AAED,IAAMC,cAAc,GAAGC,qBAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAEV,0BADmB;AAE3CW,EAAAA,sBAAsB,EAAEL,0BAAAA;AAFmB,CAAD,CAA5C;;AAMaM,IAAAA,gBAA2C,GAAGJ,cAAc,CAACJ;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import {\n sentryUnpluginFactory,\n Options,\n createRollupReleaseInjectionHooks,\n createRollupDebugIdInjectionHooks,\n createRollupDebugIdUploadHooks,\n} from \"@sentry/bundler-plugin-core\";\nimport { UnpluginOptions } from \"unplugin\";\n\nfunction viteReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-vite-release-injection-plugin\",\n enforce: \"pre\" as const, // need this so that vite runs the resolveId hook\n vite: createRollupReleaseInjectionHooks(injectionCode),\n };\n}\n\nfunction viteDebugIdInjectionPlugin(): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-injection-plugin\",\n vite: createRollupDebugIdInjectionHooks(),\n };\n}\n\nfunction viteDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-upload-plugin\",\n vite: createRollupDebugIdUploadHooks(upload),\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: viteReleaseInjectionPlugin,\n debugIdInjectionPlugin: viteDebugIdInjectionPlugin,\n debugIdUploadPlugin: viteDebugIdUploadPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryVitePlugin: (options: Options) => any = sentryUnplugin.vite;\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["viteReleaseInjectionPlugin","injectionCode","name","enforce","vite","createRollupReleaseInjectionHooks","viteDebugIdInjectionPlugin","createRollupDebugIdInjectionHooks","viteDebugIdUploadPlugin","upload","createRollupDebugIdUploadHooks","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","debugIdInjectionPlugin","debugIdUploadPlugin","sentryVitePlugin"],"mappings":";;;AASA,SAASA,0BAA0BA,CAACC,aAAqB,EAAmB;EAC1E,OAAO;AACLC,IAAAA,IAAI,EAAE,sCAAsC;AAC5CC,IAAAA,OAAO,EAAE,KAAc;AAAE;IACzBC,IAAI,EAAEC,iCAAiC,CAACJ,aAAa,CAAA;GACtD,CAAA;AACH,CAAA;AAEA,SAASK,0BAA0BA,GAAoB;EACrD,OAAO;AACLJ,IAAAA,IAAI,EAAE,uCAAuC;IAC7CE,IAAI,EAAEG,iCAAiC,EAAC;GACzC,CAAA;AACH,CAAA;AAEA,SAASC,uBAAuBA,CAC9BC,MAAmD,EAClC;EACjB,OAAO;AACLP,IAAAA,IAAI,EAAE,oCAAoC;IAC1CE,IAAI,EAAEM,8BAA8B,CAACD,MAAM,CAAA;GAC5C,CAAA;AACH,CAAA;AAEA,IAAME,cAAc,GAAGC,qBAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAEb,0BAA0B;AAClDc,EAAAA,sBAAsB,EAAER,0BAA0B;AAClDS,EAAAA,mBAAmB,EAAEP,uBAAAA;AACvB,CAAC,CAAC,CAAA;;AAEF;AACaQ,IAAAA,gBAA2C,GAAGL,cAAc,CAACP;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/vite-plugin",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Official Sentry Vite plugin",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript-bundler-plugins.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/vite-plugin",
@@ -48,7 +48,7 @@
48
48
  "prepack": "ts-node ./src/prepack.ts"
49
49
  },
50
50
  "dependencies": {
51
- "@sentry/bundler-plugin-core": "2.0.0",
51
+ "@sentry/bundler-plugin-core": "2.2.0",
52
52
  "unplugin": "1.0.1"
53
53
  },
54
54
  "devDependencies": {
@@ -57,8 +57,8 @@
57
57
  "@babel/preset-typescript": "7.17.12",
58
58
  "@rollup/plugin-babel": "5.3.1",
59
59
  "@rollup/plugin-node-resolve": "13.3.0",
60
- "@sentry-internal/eslint-config": "2.0.0",
61
- "@sentry-internal/sentry-bundler-plugin-tsconfig": "2.0.0",
60
+ "@sentry-internal/eslint-config": "2.2.0",
61
+ "@sentry-internal/sentry-bundler-plugin-tsconfig": "2.2.0",
62
62
  "@swc/core": "^1.2.205",
63
63
  "@swc/jest": "^0.2.21",
64
64
  "@types/jest": "^28.1.3",