@sentry/webpack-plugin 2.2.2 → 2.3.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 +69 -69
- package/dist/cjs/index.js +4 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +5 -3
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -57,42 +57,42 @@ module.exports = {
|
|
|
57
57
|
|
|
58
58
|
## Options
|
|
59
59
|
|
|
60
|
-
- [`org`](#
|
|
61
|
-
- [`project`](#
|
|
62
|
-
- [`authToken`](#
|
|
63
|
-
- [`url`](#
|
|
64
|
-
- [`headers`](#
|
|
65
|
-
- [`debug`](#
|
|
66
|
-
- [`silent`](#
|
|
67
|
-
- [`errorHandler`](#
|
|
68
|
-
- [`telemetry`](#
|
|
69
|
-
- [`disable`](#
|
|
70
|
-
- [`sourcemaps`](#
|
|
71
|
-
- [`assets`](#
|
|
72
|
-
- [`ignore`](#
|
|
73
|
-
- [`rewriteSources`](#
|
|
74
|
-
- [`
|
|
75
|
-
- [`release`](#
|
|
76
|
-
- [`name`](#
|
|
77
|
-
- [`inject`](#
|
|
78
|
-
- [`create`](#
|
|
79
|
-
- [`finalize`](#
|
|
80
|
-
- [`dist`](#
|
|
81
|
-
- [`vcsRemote`](#
|
|
82
|
-
- [`setCommits`](#
|
|
83
|
-
- [`deploy`](#
|
|
84
|
-
- [`cleanArtifacts`](#
|
|
85
|
-
- [`uploadLegacySourcemaps`](#
|
|
86
|
-
- [`_experiments`](#
|
|
87
|
-
- [`injectBuildInformation`](#
|
|
88
|
-
|
|
89
|
-
###
|
|
60
|
+
- [`org`](#optionorg)
|
|
61
|
+
- [`project`](#optionproject)
|
|
62
|
+
- [`authToken`](#optionauthtoken)
|
|
63
|
+
- [`url`](#optionurl)
|
|
64
|
+
- [`headers`](#optionheaders)
|
|
65
|
+
- [`debug`](#optiondebug)
|
|
66
|
+
- [`silent`](#optionsilent)
|
|
67
|
+
- [`errorHandler`](#optionerrorhandler)
|
|
68
|
+
- [`telemetry`](#optiontelemetry)
|
|
69
|
+
- [`disable`](#optiondisable)
|
|
70
|
+
- [`sourcemaps`](#optionsourcemaps)
|
|
71
|
+
- [`assets`](#optionsourcemapsassets)
|
|
72
|
+
- [`ignore`](#optionsourcemapsignore)
|
|
73
|
+
- [`rewriteSources`](#optionsourcemapsrewritesources)
|
|
74
|
+
- [`filesToDeleteAfterUpload`](#optionsourcemapsfilestodeleteafterupload)
|
|
75
|
+
- [`release`](#optionrelease)
|
|
76
|
+
- [`name`](#optionreleasename)
|
|
77
|
+
- [`inject`](#optionreleaseinject)
|
|
78
|
+
- [`create`](#optionreleasecreate)
|
|
79
|
+
- [`finalize`](#optionreleasefinalize)
|
|
80
|
+
- [`dist`](#optionreleasedist)
|
|
81
|
+
- [`vcsRemote`](#optionreleasevcsremote)
|
|
82
|
+
- [`setCommits`](#optionreleasesetcommits)
|
|
83
|
+
- [`deploy`](#optionreleasedeploy)
|
|
84
|
+
- [`cleanArtifacts`](#optionreleasecleanartifacts)
|
|
85
|
+
- [`uploadLegacySourcemaps`](#optionreleaseuploadlegacysourcemaps)
|
|
86
|
+
- [`_experiments`](#option_experiments)
|
|
87
|
+
- [`injectBuildInformation`](#option_experimentsinjectbuildinformation)
|
|
88
|
+
|
|
89
|
+
### `org`
|
|
90
90
|
|
|
91
91
|
Type: `string`
|
|
92
92
|
|
|
93
93
|
The slug of the Sentry organization associated with the app.
|
|
94
94
|
|
|
95
|
-
###
|
|
95
|
+
### `project`
|
|
96
96
|
|
|
97
97
|
|
|
98
98
|
|
|
@@ -100,7 +100,7 @@ The slug of the Sentry project associated with the app.
|
|
|
100
100
|
|
|
101
101
|
This value can also be specified via the `SENTRY_PROJECT` environment variable.
|
|
102
102
|
|
|
103
|
-
###
|
|
103
|
+
### `authToken`
|
|
104
104
|
|
|
105
105
|
Type: `string`
|
|
106
106
|
|
|
@@ -108,7 +108,7 @@ The authentication token to use for all communication with Sentry. Can be obtain
|
|
|
108
108
|
|
|
109
109
|
This value can also be specified via the `SENTRY_AUTH_TOKEN` environment variable.
|
|
110
110
|
|
|
111
|
-
###
|
|
111
|
+
### `url`
|
|
112
112
|
|
|
113
113
|
Type: `string`
|
|
114
114
|
|
|
@@ -118,25 +118,25 @@ This value can also be set via the SENTRY_URL environment variable.
|
|
|
118
118
|
|
|
119
119
|
Defaults to https://sentry.io/, which is the correct value for SaaS customers.
|
|
120
120
|
|
|
121
|
-
###
|
|
121
|
+
### `headers`
|
|
122
122
|
|
|
123
123
|
Type: `Record<string, string>`
|
|
124
124
|
|
|
125
125
|
Headers added to every outgoing network request.
|
|
126
126
|
|
|
127
|
-
###
|
|
127
|
+
### `debug`
|
|
128
128
|
|
|
129
129
|
Type: `boolean`
|
|
130
130
|
|
|
131
131
|
Print useful debug information. Defaults to `false`.
|
|
132
132
|
|
|
133
|
-
###
|
|
133
|
+
### `silent`
|
|
134
134
|
|
|
135
135
|
Type: `boolean`
|
|
136
136
|
|
|
137
137
|
Suppresses all logs. Defaults to `false`.
|
|
138
138
|
|
|
139
|
-
###
|
|
139
|
+
### `errorHandler`
|
|
140
140
|
|
|
141
141
|
Type: `(err: Error) => void`
|
|
142
142
|
|
|
@@ -153,7 +153,7 @@ errorHandler: (err) => {
|
|
|
153
153
|
```
|
|
154
154
|
|
|
155
155
|
|
|
156
|
-
###
|
|
156
|
+
### `telemetry`
|
|
157
157
|
|
|
158
158
|
Type: `boolean`
|
|
159
159
|
|
|
@@ -163,18 +163,18 @@ At Sentry we like to use Sentry ourselves to deliver faster and more stable prod
|
|
|
163
163
|
|
|
164
164
|
Defaults to `true`.
|
|
165
165
|
|
|
166
|
-
###
|
|
166
|
+
### `disable`
|
|
167
167
|
|
|
168
168
|
Type: `boolean`
|
|
169
169
|
|
|
170
170
|
Completely disables all functionality of the plugin. Defaults to `false`.
|
|
171
171
|
|
|
172
|
-
###
|
|
172
|
+
### `sourcemaps`
|
|
173
173
|
|
|
174
174
|
|
|
175
175
|
|
|
176
176
|
Options for source maps uploading. Leave this option undefined if you do not want to upload source maps to Sentry.
|
|
177
|
-
###
|
|
177
|
+
### `sourcemaps.assets`
|
|
178
178
|
|
|
179
179
|
Type: `string | string[]`
|
|
180
180
|
|
|
@@ -186,7 +186,7 @@ The globbing patterns follow the implementation of the `glob` package. (https://
|
|
|
186
186
|
|
|
187
187
|
Use the `debug` option to print information about which files end up being uploaded.
|
|
188
188
|
|
|
189
|
-
###
|
|
189
|
+
### `sourcemaps.ignore`
|
|
190
190
|
|
|
191
191
|
Type: `string | string[]`
|
|
192
192
|
|
|
@@ -198,7 +198,7 @@ The globbing patterns follow the implementation of the `glob` package. (https://
|
|
|
198
198
|
|
|
199
199
|
Use the `debug` option to print information about which files end up being uploaded.
|
|
200
200
|
|
|
201
|
-
###
|
|
201
|
+
### `sourcemaps.rewriteSources`
|
|
202
202
|
|
|
203
203
|
Type: `(source: string, map: any) => string`
|
|
204
204
|
|
|
@@ -206,7 +206,7 @@ Hook to rewrite the `sources` field inside the source map before being uploaded
|
|
|
206
206
|
|
|
207
207
|
Defaults to making all sources relative to `process.cwd()` while building.
|
|
208
208
|
|
|
209
|
-
###
|
|
209
|
+
### `sourcemaps.filesToDeleteAfterUpload`
|
|
210
210
|
|
|
211
211
|
Type: `string | string[]`
|
|
212
212
|
|
|
@@ -216,14 +216,14 @@ The globbing patterns follow the implementation of the `glob` package. (https://
|
|
|
216
216
|
|
|
217
217
|
Use the `debug` option to print information about which files end up being deleted.
|
|
218
218
|
|
|
219
|
-
###
|
|
219
|
+
### `release`
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
|
|
223
223
|
Options related to managing the Sentry releases for a build.
|
|
224
224
|
|
|
225
225
|
More info: https://docs.sentry.io/product/releases/
|
|
226
|
-
###
|
|
226
|
+
### `release.name`
|
|
227
227
|
|
|
228
228
|
Type: `string`
|
|
229
229
|
|
|
@@ -235,7 +235,7 @@ Defaults to automatically detecting a value for your environment. This includes
|
|
|
235
235
|
|
|
236
236
|
If you didn't provide a value and the plugin can't automatically detect one, no release will be created.
|
|
237
237
|
|
|
238
|
-
###
|
|
238
|
+
### `release.inject`
|
|
239
239
|
|
|
240
240
|
Type: `boolean`
|
|
241
241
|
|
|
@@ -243,7 +243,7 @@ Whether the plugin should inject release information into the build for the SDK
|
|
|
243
243
|
|
|
244
244
|
Defaults to `true`.
|
|
245
245
|
|
|
246
|
-
###
|
|
246
|
+
### `release.create`
|
|
247
247
|
|
|
248
248
|
Type: `boolean`
|
|
249
249
|
|
|
@@ -251,7 +251,7 @@ Whether the plugin should create a release on Sentry during the build. Note that
|
|
|
251
251
|
|
|
252
252
|
Defaults to `true`.
|
|
253
253
|
|
|
254
|
-
###
|
|
254
|
+
### `release.finalize`
|
|
255
255
|
|
|
256
256
|
Type: `boolean`
|
|
257
257
|
|
|
@@ -259,13 +259,13 @@ Whether the Sentry release should be automatically finalized (meaning an end tim
|
|
|
259
259
|
|
|
260
260
|
Defaults to `true`.
|
|
261
261
|
|
|
262
|
-
###
|
|
262
|
+
### `release.dist`
|
|
263
263
|
|
|
264
264
|
Type: `string`
|
|
265
265
|
|
|
266
266
|
Unique identifier for the distribution, used to further segment your release.
|
|
267
267
|
|
|
268
|
-
###
|
|
268
|
+
### `release.vcsRemote`
|
|
269
269
|
|
|
270
270
|
Type: `string`
|
|
271
271
|
|
|
@@ -275,12 +275,12 @@ This value can also be specified via the `SENTRY_VSC_REMOTE` environment variabl
|
|
|
275
275
|
|
|
276
276
|
Defaults to 'origin'.
|
|
277
277
|
|
|
278
|
-
###
|
|
278
|
+
### `release.setCommits`
|
|
279
279
|
|
|
280
280
|
|
|
281
281
|
|
|
282
282
|
Option to associate the created release with its commits in Sentry.
|
|
283
|
-
###
|
|
283
|
+
### `release.setCommits.previousCommit`
|
|
284
284
|
|
|
285
285
|
Type: `string`
|
|
286
286
|
|
|
@@ -290,7 +290,7 @@ Defaults to the last commit of the previous release in Sentry.
|
|
|
290
290
|
|
|
291
291
|
If there was no previous release, the last 10 commits will be used.
|
|
292
292
|
|
|
293
|
-
###
|
|
293
|
+
### `release.setCommits.ignoreMissing`
|
|
294
294
|
|
|
295
295
|
Type: `boolean`
|
|
296
296
|
|
|
@@ -298,7 +298,7 @@ If the flag is to `true` and the previous release commit was not found in the re
|
|
|
298
298
|
|
|
299
299
|
Defaults to `false`.
|
|
300
300
|
|
|
301
|
-
###
|
|
301
|
+
### `release.setCommits.ignoreEmpty`
|
|
302
302
|
|
|
303
303
|
Type: `boolean`
|
|
304
304
|
|
|
@@ -306,7 +306,7 @@ If this flag is set, the setCommits step will not fail and just exit silently if
|
|
|
306
306
|
|
|
307
307
|
Defaults to `false`.
|
|
308
308
|
|
|
309
|
-
###
|
|
309
|
+
### `release.setCommits.auto`
|
|
310
310
|
|
|
311
311
|
Type: `boolean`
|
|
312
312
|
|
|
@@ -314,7 +314,7 @@ Automatically sets `commit` and `previousCommit`. Sets `commit` to `HEAD` and `p
|
|
|
314
314
|
|
|
315
315
|
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`.
|
|
316
316
|
|
|
317
|
-
###
|
|
317
|
+
### `release.setCommits.repo`
|
|
318
318
|
|
|
319
319
|
Type: `string`
|
|
320
320
|
|
|
@@ -322,7 +322,7 @@ The full repo name as defined in Sentry.
|
|
|
322
322
|
|
|
323
323
|
Required if the `auto` option is not set to `true`.
|
|
324
324
|
|
|
325
|
-
###
|
|
325
|
+
### `release.setCommits.commit`
|
|
326
326
|
|
|
327
327
|
Type: `string`
|
|
328
328
|
|
|
@@ -330,48 +330,48 @@ The current (last) commit in the release.
|
|
|
330
330
|
|
|
331
331
|
Required if the `auto` option is not set to `true`.
|
|
332
332
|
|
|
333
|
-
###
|
|
333
|
+
### `release.deploy`
|
|
334
334
|
|
|
335
335
|
|
|
336
336
|
|
|
337
337
|
Adds deployment information to the release in Sentry.
|
|
338
|
-
###
|
|
338
|
+
### `release.deploy.env`
|
|
339
339
|
|
|
340
340
|
Type: `string`
|
|
341
341
|
|
|
342
342
|
Environment for this release. Values that make sense here would be `production` or `staging`.
|
|
343
343
|
|
|
344
|
-
###
|
|
344
|
+
### `release.deploy.started`
|
|
345
345
|
|
|
346
346
|
Type: `number | string`
|
|
347
347
|
|
|
348
348
|
Deployment start time in Unix timestamp (in seconds) or ISO 8601 format.
|
|
349
349
|
|
|
350
|
-
###
|
|
350
|
+
### `release.deploy.finished`
|
|
351
351
|
|
|
352
352
|
Type: `number | string`
|
|
353
353
|
|
|
354
354
|
Deployment finish time in Unix timestamp (in seconds) or ISO 8601 format.
|
|
355
355
|
|
|
356
|
-
###
|
|
356
|
+
### `release.deploy.time`
|
|
357
357
|
|
|
358
358
|
Type: `number`
|
|
359
359
|
|
|
360
360
|
Deployment duration (in seconds). Can be used instead of started and finished.
|
|
361
361
|
|
|
362
|
-
###
|
|
362
|
+
### `release.deploy.name`
|
|
363
363
|
|
|
364
364
|
Type: `string`
|
|
365
365
|
|
|
366
366
|
Human readable name for the deployment.
|
|
367
367
|
|
|
368
|
-
###
|
|
368
|
+
### `release.deploy.url`
|
|
369
369
|
|
|
370
370
|
Type: `string`
|
|
371
371
|
|
|
372
372
|
URL that points to the deployment.
|
|
373
373
|
|
|
374
|
-
###
|
|
374
|
+
### `release.cleanArtifacts`
|
|
375
375
|
|
|
376
376
|
Type: `boolean`
|
|
377
377
|
|
|
@@ -379,7 +379,7 @@ Remove all previously uploaded artifacts for this release on Sentry before the u
|
|
|
379
379
|
|
|
380
380
|
Defaults to `false`.
|
|
381
381
|
|
|
382
|
-
###
|
|
382
|
+
### `release.uploadLegacySourcemaps`
|
|
383
383
|
|
|
384
384
|
Type: `string | IncludeEntry | Array<string | IncludeEntry>`
|
|
385
385
|
|
|
@@ -479,12 +479,12 @@ type IncludeEntry = {
|
|
|
479
479
|
|
|
480
480
|
|
|
481
481
|
|
|
482
|
-
###
|
|
482
|
+
### `_experiments`
|
|
483
483
|
|
|
484
484
|
Type: `string`
|
|
485
485
|
|
|
486
486
|
Options that are considered experimental and subject to change. This option does not follow semantic versioning and may change in any release.
|
|
487
|
-
###
|
|
487
|
+
### `_experiments.injectBuildInformation`
|
|
488
488
|
|
|
489
489
|
Type: `boolean`
|
|
490
490
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -63,8 +63,10 @@ function webpackDebugIdInjectionPlugin() {
|
|
|
63
63
|
new BannerPlugin({
|
|
64
64
|
raw: true,
|
|
65
65
|
include: /\.(js|ts|jsx|tsx|mjs|cjs)$/,
|
|
66
|
-
banner: function banner() {
|
|
67
|
-
|
|
66
|
+
banner: function banner(arg) {
|
|
67
|
+
var _arg$chunk;
|
|
68
|
+
var debugId = arg !== null && arg !== void 0 && (_arg$chunk = arg.chunk) !== null && _arg$chunk !== void 0 && _arg$chunk.hash ? bundlerPluginCore.stringToUUID(arg.chunk.hash) : uuid.v4();
|
|
69
|
+
return bundlerPluginCore.getDebugIdSnippet(debugId);
|
|
68
70
|
}
|
|
69
71
|
}));
|
|
70
72
|
}
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n getDebugIdSnippet,\n Options,\n sentryUnpluginFactory,\n stringToUUID,\n} from \"@sentry/bundler-plugin-core\";\nimport * as path from \"path\";\nimport { UnpluginOptions } from \"unplugin\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore webpack is a peer dep\nimport * as webback4or5 from \"webpack\";\n\ninterface BannerPluginCallbackArg {\n chunk?: {\n hash?: string;\n };\n}\n\nfunction webpackReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-webpack-release-injection-plugin\",\n webpack(compiler) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore webpack version compatibility shenanigans\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n const BannerPlugin = compiler?.webpack?.BannerPlugin || webback4or5?.BannerPlugin;\n compiler.options.plugins = compiler.options.plugins || [];\n compiler.options.plugins.push(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call\n new BannerPlugin({\n raw: true,\n include: /\\.(js|ts|jsx|tsx|mjs|cjs)$/,\n banner: injectionCode,\n })\n );\n },\n };\n}\n\nfunction webpackDebugIdInjectionPlugin(): UnpluginOptions {\n return {\n name: \"sentry-webpack-debug-id-injection-plugin\",\n webpack(compiler) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore webpack version compatibility shenanigans\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n const BannerPlugin = compiler?.webpack?.BannerPlugin || webback4or5?.BannerPlugin;\n compiler.options.plugins = compiler.options.plugins || [];\n compiler.options.plugins.push(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call\n new BannerPlugin({\n raw: true,\n include: /\\.(js|ts|jsx|tsx|mjs|cjs)$/,\n banner: (arg?: BannerPluginCallbackArg) => {\n const debugId = arg?.chunk?.hash ? stringToUUID(arg.chunk.hash) : uuidv4();\n return getDebugIdSnippet(debugId);\n },\n })\n );\n },\n };\n}\n\nfunction webpackDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n const pluginName = \"sentry-webpack-debug-id-upload-plugin\";\n return {\n name: pluginName,\n webpack(compiler) {\n compiler.hooks.afterEmit.tapAsync(pluginName, (compilation, callback: () => void) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const outputPath = (compilation.outputOptions.path as string | undefined) ?? path.resolve();\n const buildArtifacts = Object.keys(compilation.assets as Record<string, unknown>).map(\n (asset) => path.join(outputPath, asset)\n );\n void upload(buildArtifacts).then(() => {\n callback();\n });\n });\n },\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: webpackReleaseInjectionPlugin,\n debugIdInjectionPlugin: webpackDebugIdInjectionPlugin,\n debugIdUploadPlugin: webpackDebugIdUploadPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryWebpackPlugin: (options: Options) => any = sentryUnplugin.webpack;\n\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\nexport type { Options as SentryWebpackPluginOptions } from \"@sentry/bundler-plugin-core\";\n"],"names":["webpackReleaseInjectionPlugin","injectionCode","name","webpack","compiler","_compiler$webpack","BannerPlugin","webback4or5","options","plugins","push","raw","include","banner","webpackDebugIdInjectionPlugin","_compiler$webpack2","arg","_arg$chunk","debugId","chunk","hash","stringToUUID","uuidv4","getDebugIdSnippet","webpackDebugIdUploadPlugin","upload","pluginName","hooks","afterEmit","tapAsync","compilation","callback","_ref","outputPath","outputOptions","path","resolve","buildArtifacts","Object","keys","assets","map","asset","join","then","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","debugIdInjectionPlugin","debugIdUploadPlugin","sentryWebpackPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAASA,6BAA6BA,CAACC,aAAqB,EAAmB;EAC7E,OAAO;AACLC,IAAAA,IAAI,EAAE,yCAAyC;IAC/CC,OAAO,EAAA,SAAAA,OAACC,CAAAA,QAAQ,EAAE;AAAA,MAAA,IAAAC,iBAAA,CAAA;AAChB;AACA;AACA;MACA,IAAMC,YAAY,GAAG,CAAAF,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAAAC,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,CAAAA,iBAAA,GAARD,QAAQ,CAAED,OAAO,cAAAE,iBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAjBA,iBAAA,CAAmBC,YAAY,M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AKjB,MAAM,CAACY,cAAc,CAAC,CAACO,IAAI,CAAC,YAAM;AACrCb,UAAAA,QAAQ,EAAE,CAAA;AACZ,SAAC,CAAC,CAAA;AACJ,OAAC,CAAC,CAAA;AACJ,KAAA;GACD,CAAA;AACH,CAAA;AAEA,IAAMc,cAAc,GAAGC,uCAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAE/C,6BAA6B;AACrDgD,EAAAA,sBAAsB,EAAElC,6BAA6B;AACrDmC,EAAAA,mBAAmB,EAAEzB,0BAAAA;AACvB,CAAC,CAAC,CAAA;;AAEF;AACa0B,IAAAA,mBAA8C,GAAGL,cAAc,CAAC1C;;;;;;;;"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sentryUnpluginFactory, getDebugIdSnippet } from '@sentry/bundler-plugin-core';
|
|
1
|
+
import { sentryUnpluginFactory, stringToUUID, getDebugIdSnippet } from '@sentry/bundler-plugin-core';
|
|
2
2
|
export { sentryCliBinaryExists } from '@sentry/bundler-plugin-core';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import { v4 } from 'uuid';
|
|
@@ -39,8 +39,10 @@ function webpackDebugIdInjectionPlugin() {
|
|
|
39
39
|
new BannerPlugin({
|
|
40
40
|
raw: true,
|
|
41
41
|
include: /\.(js|ts|jsx|tsx|mjs|cjs)$/,
|
|
42
|
-
banner: function banner() {
|
|
43
|
-
|
|
42
|
+
banner: function banner(arg) {
|
|
43
|
+
var _arg$chunk;
|
|
44
|
+
var debugId = arg !== null && arg !== void 0 && (_arg$chunk = arg.chunk) !== null && _arg$chunk !== void 0 && _arg$chunk.hash ? stringToUUID(arg.chunk.hash) : v4();
|
|
45
|
+
return getDebugIdSnippet(debugId);
|
|
44
46
|
}
|
|
45
47
|
}));
|
|
46
48
|
}
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import {\n getDebugIdSnippet,\n Options,\n sentryUnpluginFactory,\n stringToUUID,\n} from \"@sentry/bundler-plugin-core\";\nimport * as path from \"path\";\nimport { UnpluginOptions } from \"unplugin\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore webpack is a peer dep\nimport * as webback4or5 from \"webpack\";\n\ninterface BannerPluginCallbackArg {\n chunk?: {\n hash?: string;\n };\n}\n\nfunction webpackReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-webpack-release-injection-plugin\",\n webpack(compiler) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore webpack version compatibility shenanigans\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n const BannerPlugin = compiler?.webpack?.BannerPlugin || webback4or5?.BannerPlugin;\n compiler.options.plugins = compiler.options.plugins || [];\n compiler.options.plugins.push(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call\n new BannerPlugin({\n raw: true,\n include: /\\.(js|ts|jsx|tsx|mjs|cjs)$/,\n banner: injectionCode,\n })\n );\n },\n };\n}\n\nfunction webpackDebugIdInjectionPlugin(): UnpluginOptions {\n return {\n name: \"sentry-webpack-debug-id-injection-plugin\",\n webpack(compiler) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore webpack version compatibility shenanigans\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n const BannerPlugin = compiler?.webpack?.BannerPlugin || webback4or5?.BannerPlugin;\n compiler.options.plugins = compiler.options.plugins || [];\n compiler.options.plugins.push(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call\n new BannerPlugin({\n raw: true,\n include: /\\.(js|ts|jsx|tsx|mjs|cjs)$/,\n banner: (arg?: BannerPluginCallbackArg) => {\n const debugId = arg?.chunk?.hash ? stringToUUID(arg.chunk.hash) : uuidv4();\n return getDebugIdSnippet(debugId);\n },\n })\n );\n },\n };\n}\n\nfunction webpackDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n const pluginName = \"sentry-webpack-debug-id-upload-plugin\";\n return {\n name: pluginName,\n webpack(compiler) {\n compiler.hooks.afterEmit.tapAsync(pluginName, (compilation, callback: () => void) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const outputPath = (compilation.outputOptions.path as string | undefined) ?? path.resolve();\n const buildArtifacts = Object.keys(compilation.assets as Record<string, unknown>).map(\n (asset) => path.join(outputPath, asset)\n );\n void upload(buildArtifacts).then(() => {\n callback();\n });\n });\n },\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: webpackReleaseInjectionPlugin,\n debugIdInjectionPlugin: webpackDebugIdInjectionPlugin,\n debugIdUploadPlugin: webpackDebugIdUploadPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryWebpackPlugin: (options: Options) => any = sentryUnplugin.webpack;\n\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\nexport type { Options as SentryWebpackPluginOptions } from \"@sentry/bundler-plugin-core\";\n"],"names":["webpackReleaseInjectionPlugin","injectionCode","name","webpack","compiler","_compiler$webpack","BannerPlugin","webback4or5","options","plugins","push","raw","include","banner","webpackDebugIdInjectionPlugin","_compiler$webpack2","arg","_arg$chunk","debugId","chunk","hash","stringToUUID","uuidv4","getDebugIdSnippet","webpackDebugIdUploadPlugin","upload","pluginName","hooks","afterEmit","tapAsync","compilation","callback","_ref","outputPath","outputOptions","path","resolve","buildArtifacts","Object","keys","assets","map","asset","join","then","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","debugIdInjectionPlugin","debugIdUplo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WAAW,EAAEC,QAAoB,EAAK;AAAA,QAAA,IAAAC,IAAA,CAAA;AACnF;AACA,QAAA,IAAMC,UAAU,GAAAD,CAAAA,IAAA,GAAIF,WAAW,CAACI,aAAa,CAACC,IAAI,MAAAH,IAAAA,IAAAA,IAAA,cAAAA,IAAA,GAA2BG,IAAI,CAACC,OAAO,EAAE,CAAA;AAC3F,QAAA,IAAMC,cAAc,GAAGC,MAAM,CAACC,IAAI,CAACT,WAAW,CAACU,MAAiC,CAAC,CAACC,GAAG,CACnF,UAACC,KAAK,EAAA;AAAA,UAAA,OAAKP,IAAI,CAACQ,IAAI,CAACV,UAAU,EAAES,KAAK,CAAC,CAAA;AAAA,SACzC,CAAC,CAAA;AACD,QAAA,KAAKjB,MAAM,CAACY,cAAc,CAAC,CAACO,IAAI,CAAC,YAAM;AACrCb,UAAAA,QAAQ,EAAE,CAAA;AACZ,SAAC,CAAC,CAAA;AACJ,OAAC,CAAC,CAAA;AACJ,KAAA;GACD,CAAA;AACH,CAAA;AAEA,IAAMc,cAAc,GAAGC,qBAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAE/C,6BAA6B;AACrDgD,EAAAA,sBAAsB,EAAElC,6BAA6B;AACrDmC,EAAAA,mBAAmB,EAAEzB,0BAAAA;AACvB,CAAC,CAAC,CAAA;;AAEF;AACa0B,IAAAA,mBAA8C,GAAGL,cAAc,CAAC1C;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/webpack-plugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Official Sentry Webpack 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/webpack-plugin",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"prepack": "ts-node ./src/prepack.ts"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@sentry/bundler-plugin-core": "2.
|
|
51
|
+
"@sentry/bundler-plugin-core": "2.3.0",
|
|
52
52
|
"unplugin": "1.0.1",
|
|
53
53
|
"uuid": "^9.0.0"
|
|
54
54
|
},
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@babel/preset-typescript": "7.17.12",
|
|
59
59
|
"@rollup/plugin-babel": "5.3.1",
|
|
60
60
|
"@rollup/plugin-commonjs": "22.0.1",
|
|
61
|
-
"@sentry-internal/eslint-config": "2.
|
|
62
|
-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "2.
|
|
61
|
+
"@sentry-internal/eslint-config": "2.3.0",
|
|
62
|
+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "2.3.0",
|
|
63
63
|
"@swc/core": "^1.2.205",
|
|
64
64
|
"@swc/jest": "^0.2.21",
|
|
65
65
|
"@types/jest": "^28.1.3",
|