@sentry/nuxt 9.10.1 → 9.11.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/build/cjs/vite/sourceMaps.js +169 -74
- package/build/cjs/vite/sourceMaps.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/vite/sourceMaps.js +168 -73
- package/build/esm/vite/sourceMaps.js.map +1 -1
- package/build/module/module.json +1 -1
- package/build/module/module.mjs +106 -54
- package/build/types/vite/sourceMaps.d.ts +27 -16
- package/build/types/vite/sourceMaps.d.ts.map +1 -1
- package/package.json +7 -6
|
@@ -12,24 +12,77 @@ const vitePlugin = require('@sentry/vite-plugin');
|
|
|
12
12
|
* Setup source maps for Sentry inside the Nuxt module during build time (in Vite for Nuxt and Rollup for Nitro).
|
|
13
13
|
*/
|
|
14
14
|
function setupSourceMaps(moduleOptions, nuxt) {
|
|
15
|
+
const isDebug = moduleOptions.debug;
|
|
16
|
+
|
|
15
17
|
const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};
|
|
16
18
|
const sourceMapsEnabled = sourceMapsUploadOptions.enabled ?? true;
|
|
17
19
|
|
|
20
|
+
// In case we overwrite the source map settings, we default to deleting the files
|
|
21
|
+
let shouldDeleteFilesFallback = { client: true, server: true };
|
|
22
|
+
|
|
18
23
|
nuxt.hook('modules:done', () => {
|
|
19
24
|
if (sourceMapsEnabled && !nuxt.options.dev) {
|
|
20
|
-
|
|
25
|
+
// Changing this setting will propagate:
|
|
26
|
+
// - for client to viteConfig.build.sourceMap
|
|
27
|
+
// - for server to viteConfig.build.sourceMap and nitro.sourceMap
|
|
28
|
+
// On server, nitro.rollupConfig.output.sourcemap remains unaffected from this change.
|
|
29
|
+
|
|
30
|
+
// ONLY THIS nuxt.sourcemap.(server/client) setting is the one Sentry will eventually overwrite with 'hidden'
|
|
31
|
+
const previousSourceMapSettings = changeNuxtSourceMapSettings(nuxt, moduleOptions);
|
|
32
|
+
|
|
33
|
+
shouldDeleteFilesFallback = {
|
|
34
|
+
client: previousSourceMapSettings.client === 'unset',
|
|
35
|
+
server: previousSourceMapSettings.server === 'unset',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
if (
|
|
39
|
+
isDebug &&
|
|
40
|
+
!sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload &&
|
|
41
|
+
(shouldDeleteFilesFallback.client || shouldDeleteFilesFallback.server)
|
|
42
|
+
) {
|
|
43
|
+
core.consoleSandbox(() =>
|
|
44
|
+
// eslint-disable-next-line no-console
|
|
45
|
+
console.log(
|
|
46
|
+
"[Sentry] As Sentry enabled `'hidden'` source maps, source maps will be automatically deleted after uploading them to Sentry.",
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
}
|
|
21
50
|
}
|
|
22
51
|
});
|
|
23
52
|
|
|
24
|
-
nuxt.hook('vite:extendConfig', async (viteConfig,
|
|
53
|
+
nuxt.hook('vite:extendConfig', async (viteConfig, env) => {
|
|
25
54
|
if (sourceMapsEnabled && viteConfig.mode !== 'development') {
|
|
26
|
-
const
|
|
55
|
+
const runtime = env.isServer ? 'server' : env.isClient ? 'client' : undefined;
|
|
56
|
+
const nuxtSourceMapSetting = extractNuxtSourceMapSetting(nuxt, runtime);
|
|
57
|
+
|
|
58
|
+
viteConfig.build = viteConfig.build || {};
|
|
59
|
+
const viteSourceMap = viteConfig.build.sourcemap;
|
|
60
|
+
|
|
61
|
+
// Vite source map options are the same as the Nuxt source map config options (unless overwritten)
|
|
62
|
+
validateDifferentSourceMapSettings({
|
|
63
|
+
nuxtSettingKey: `sourcemap.${runtime}`,
|
|
64
|
+
nuxtSettingValue: nuxtSourceMapSetting,
|
|
65
|
+
otherSettingKey: 'viteConfig.build.sourcemap',
|
|
66
|
+
otherSettingValue: viteSourceMap,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
if (isDebug) {
|
|
70
|
+
core.consoleSandbox(() => {
|
|
71
|
+
if (!runtime) {
|
|
72
|
+
// eslint-disable-next-line no-console
|
|
73
|
+
console.log("[Sentry] Cannot detect runtime (client/server) inside hook 'vite:extendConfig'.");
|
|
74
|
+
} else {
|
|
75
|
+
// eslint-disable-next-line no-console
|
|
76
|
+
console.log(`[Sentry] Adding Sentry Vite plugin to the ${runtime} runtime.`);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
27
80
|
|
|
28
|
-
//
|
|
81
|
+
// Add Sentry plugin
|
|
82
|
+
// Vite plugin is added on the client and server side (hook runs twice)
|
|
83
|
+
// Nuxt client source map is 'false' by default. Warning about this will be shown already in an earlier step, and it's also documented that `nuxt.sourcemap.client` needs to be enabled.
|
|
29
84
|
viteConfig.plugins = viteConfig.plugins || [];
|
|
30
|
-
viteConfig.plugins.push(
|
|
31
|
-
vitePlugin.sentryVitePlugin(getPluginOptions(moduleOptions, previousUserSourceMapSetting === 'unset')),
|
|
32
|
-
);
|
|
85
|
+
viteConfig.plugins.push(vitePlugin.sentryVitePlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)));
|
|
33
86
|
}
|
|
34
87
|
});
|
|
35
88
|
|
|
@@ -46,11 +99,19 @@ function setupSourceMaps(moduleOptions, nuxt) {
|
|
|
46
99
|
nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];
|
|
47
100
|
}
|
|
48
101
|
|
|
49
|
-
|
|
102
|
+
validateNitroSourceMapSettings(nuxt, nitroConfig, moduleOptions);
|
|
103
|
+
|
|
104
|
+
if (isDebug) {
|
|
105
|
+
core.consoleSandbox(() => {
|
|
106
|
+
// eslint-disable-next-line no-console
|
|
107
|
+
console.log('[Sentry] Adding Sentry Rollup plugin to the server runtime.');
|
|
108
|
+
});
|
|
109
|
+
}
|
|
50
110
|
|
|
51
111
|
// Add Sentry plugin
|
|
112
|
+
// Runs only on server-side (Nitro)
|
|
52
113
|
nitroConfig.rollupConfig.plugins.push(
|
|
53
|
-
rollupPlugin.sentryRollupPlugin(getPluginOptions(moduleOptions,
|
|
114
|
+
rollupPlugin.sentryRollupPlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)),
|
|
54
115
|
);
|
|
55
116
|
}
|
|
56
117
|
});
|
|
@@ -70,15 +131,29 @@ function normalizePath(path) {
|
|
|
70
131
|
*/
|
|
71
132
|
function getPluginOptions(
|
|
72
133
|
moduleOptions,
|
|
73
|
-
|
|
134
|
+
shouldDeleteFilesFallback,
|
|
74
135
|
) {
|
|
75
136
|
const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};
|
|
76
137
|
|
|
77
|
-
|
|
138
|
+
const shouldDeleteFilesAfterUpload = shouldDeleteFilesFallback?.client || shouldDeleteFilesFallback?.server;
|
|
139
|
+
const fallbackFilesToDelete = [
|
|
140
|
+
...(shouldDeleteFilesFallback?.client ? ['.*/**/public/**/*.map'] : []),
|
|
141
|
+
...(shouldDeleteFilesFallback?.server
|
|
142
|
+
? ['.*/**/server/**/*.map', '.*/**/output/**/*.map', '.*/**/function/**/*.map']
|
|
143
|
+
: []),
|
|
144
|
+
];
|
|
145
|
+
|
|
146
|
+
if (
|
|
147
|
+
typeof sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload === 'undefined' &&
|
|
148
|
+
shouldDeleteFilesAfterUpload
|
|
149
|
+
) {
|
|
78
150
|
core.consoleSandbox(() => {
|
|
79
151
|
// eslint-disable-next-line no-console
|
|
80
152
|
console.log(
|
|
81
|
-
|
|
153
|
+
`[Sentry] Setting \`sentry.sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload: [${fallbackFilesToDelete
|
|
154
|
+
// Logging it as strings in the array
|
|
155
|
+
.map(path => `"${path}"`)
|
|
156
|
+
.join(', ')}]\` to delete generated source maps after they were uploaded to Sentry.`,
|
|
82
157
|
);
|
|
83
158
|
});
|
|
84
159
|
}
|
|
@@ -111,8 +186,8 @@ function getPluginOptions(
|
|
|
111
186
|
ignore: sourceMapsUploadOptions.sourcemaps?.ignore ?? undefined,
|
|
112
187
|
filesToDeleteAfterUpload: sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload
|
|
113
188
|
? sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload
|
|
114
|
-
:
|
|
115
|
-
?
|
|
189
|
+
: shouldDeleteFilesFallback?.server || shouldDeleteFilesFallback?.client
|
|
190
|
+
? fallbackFilesToDelete
|
|
116
191
|
: undefined,
|
|
117
192
|
rewriteSources: (source) => normalizePath(source),
|
|
118
193
|
...moduleOptions?.unstable_sentryBundlerPluginOptions?.sourcemaps,
|
|
@@ -120,7 +195,7 @@ function getPluginOptions(
|
|
|
120
195
|
};
|
|
121
196
|
}
|
|
122
197
|
|
|
123
|
-
/* There are
|
|
198
|
+
/* There are multiple ways to set up source maps (https://github.com/getsentry/sentry-javascript/issues/13993 and https://github.com/getsentry/sentry-javascript/pull/15859)
|
|
124
199
|
1. User explicitly disabled source maps
|
|
125
200
|
- keep this setting (emit a warning that errors won't be unminified in Sentry)
|
|
126
201
|
- We will not upload anything
|
|
@@ -130,11 +205,24 @@ function getPluginOptions(
|
|
|
130
205
|
- we enable 'hidden' source maps generation
|
|
131
206
|
- configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)
|
|
132
207
|
|
|
133
|
-
|
|
134
|
-
Ideally, all 3 are enabled to get all source maps.
|
|
208
|
+
Users only have to explicitly enable client source maps. Sentry only overwrites the base Nuxt source map settings as they propagate.
|
|
135
209
|
*/
|
|
136
210
|
|
|
137
|
-
/** only exported for
|
|
211
|
+
/** only exported for tests */
|
|
212
|
+
function extractNuxtSourceMapSetting(
|
|
213
|
+
nuxt,
|
|
214
|
+
runtime,
|
|
215
|
+
) {
|
|
216
|
+
if (!runtime) {
|
|
217
|
+
return undefined;
|
|
218
|
+
} else {
|
|
219
|
+
return typeof nuxt.options?.sourcemap === 'boolean' || typeof nuxt.options?.sourcemap === 'string'
|
|
220
|
+
? nuxt.options.sourcemap
|
|
221
|
+
: nuxt.options?.sourcemap?.[runtime];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/** only exported for testing */
|
|
138
226
|
function changeNuxtSourceMapSettings(
|
|
139
227
|
nuxt,
|
|
140
228
|
sentryModuleOptions,
|
|
@@ -157,7 +245,7 @@ function changeNuxtSourceMapSettings(
|
|
|
157
245
|
|
|
158
246
|
case 'hidden':
|
|
159
247
|
case true:
|
|
160
|
-
|
|
248
|
+
logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap', (nuxtSourceMap ).toString());
|
|
161
249
|
previousUserSourceMapSetting = { client: 'enabled', server: 'enabled' };
|
|
162
250
|
break;
|
|
163
251
|
case undefined:
|
|
@@ -172,7 +260,7 @@ function changeNuxtSourceMapSettings(
|
|
|
172
260
|
warnExplicitlyDisabledSourceMap('sourcemap.client');
|
|
173
261
|
previousUserSourceMapSetting.client = 'disabled';
|
|
174
262
|
} else if (['hidden', true].includes(nuxtSourceMap.client)) {
|
|
175
|
-
|
|
263
|
+
logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.client', nuxtSourceMap.client.toString());
|
|
176
264
|
previousUserSourceMapSetting.client = 'enabled';
|
|
177
265
|
} else {
|
|
178
266
|
nuxt.options.sourcemap.client = 'hidden';
|
|
@@ -184,7 +272,7 @@ function changeNuxtSourceMapSettings(
|
|
|
184
272
|
warnExplicitlyDisabledSourceMap('sourcemap.server');
|
|
185
273
|
previousUserSourceMapSetting.server = 'disabled';
|
|
186
274
|
} else if (['hidden', true].includes(nuxtSourceMap.server)) {
|
|
187
|
-
|
|
275
|
+
logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.server', nuxtSourceMap.server.toString());
|
|
188
276
|
previousUserSourceMapSetting.server = 'enabled';
|
|
189
277
|
} else {
|
|
190
278
|
nuxt.options.sourcemap.server = 'hidden';
|
|
@@ -196,69 +284,76 @@ function changeNuxtSourceMapSettings(
|
|
|
196
284
|
return previousUserSourceMapSetting;
|
|
197
285
|
}
|
|
198
286
|
|
|
199
|
-
/**
|
|
200
|
-
|
|
201
|
-
|
|
287
|
+
/** Logs warnings about potentially conflicting source map settings.
|
|
288
|
+
* Configures `sourcemapExcludeSources` in Nitro to make source maps usable in Sentry.
|
|
289
|
+
*
|
|
290
|
+
* only exported for testing
|
|
291
|
+
*/
|
|
292
|
+
function validateNitroSourceMapSettings(
|
|
293
|
+
nuxt,
|
|
294
|
+
nitroConfig,
|
|
202
295
|
sentryModuleOptions,
|
|
203
296
|
) {
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
let previousUserSourceMapSetting;
|
|
297
|
+
const isDebug = sentryModuleOptions.debug;
|
|
298
|
+
const nuxtSourceMap = extractNuxtSourceMapSetting(nuxt, 'server');
|
|
208
299
|
|
|
209
|
-
|
|
210
|
-
warnExplicitlyDisabledSourceMap('vite.build.sourcemap');
|
|
211
|
-
previousUserSourceMapSetting = 'disabled';
|
|
212
|
-
} else if (viteSourceMap && ['hidden', 'inline', true].includes(viteSourceMap)) {
|
|
213
|
-
logKeepSourceMapSetting(sentryModuleOptions, 'vite.build.sourcemap', viteSourceMap.toString());
|
|
214
|
-
previousUserSourceMapSetting = 'enabled';
|
|
215
|
-
} else {
|
|
216
|
-
viteConfig.build.sourcemap = 'hidden';
|
|
217
|
-
logSentryEnablesSourceMap('vite.build.sourcemap', 'hidden');
|
|
218
|
-
previousUserSourceMapSetting = 'unset';
|
|
219
|
-
}
|
|
300
|
+
// NITRO CONFIG ---
|
|
220
301
|
|
|
221
|
-
|
|
222
|
-
|
|
302
|
+
validateDifferentSourceMapSettings({
|
|
303
|
+
nuxtSettingKey: 'sourcemap.server',
|
|
304
|
+
nuxtSettingValue: nuxtSourceMap,
|
|
305
|
+
otherSettingKey: 'nitro.sourceMap',
|
|
306
|
+
otherSettingValue: nitroConfig.sourceMap,
|
|
307
|
+
});
|
|
223
308
|
|
|
224
|
-
|
|
225
|
-
function changeRollupSourceMapSettings(
|
|
226
|
-
nitroConfig
|
|
309
|
+
// ROLLUP CONFIG ---
|
|
227
310
|
|
|
228
|
-
,
|
|
229
|
-
sentryModuleOptions,
|
|
230
|
-
) {
|
|
231
311
|
nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};
|
|
232
312
|
nitroConfig.rollupConfig.output = nitroConfig.rollupConfig.output || { sourcemap: undefined };
|
|
313
|
+
const nitroRollupSourceMap = nitroConfig.rollupConfig.output.sourcemap;
|
|
233
314
|
|
|
234
|
-
|
|
315
|
+
// We don't override nitro.rollupConfig.output.sourcemap (undefined by default, but overrides all other server-side source map settings)
|
|
316
|
+
if (typeof nitroRollupSourceMap !== 'undefined' && ['hidden', 'inline', true, false].includes(nitroRollupSourceMap)) {
|
|
317
|
+
const settingKey = 'nitro.rollupConfig.output.sourcemap';
|
|
235
318
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
logKeepSourceMapSetting(sentryModuleOptions, 'nitro.rollupConfig.output.sourcemap', nitroSourceMap.toString());
|
|
243
|
-
previousUserSourceMapSetting = 'enabled';
|
|
244
|
-
} else {
|
|
245
|
-
nitroConfig.rollupConfig.output.sourcemap = 'hidden';
|
|
246
|
-
logSentryEnablesSourceMap('nitro.rollupConfig.output.sourcemap', 'hidden');
|
|
247
|
-
previousUserSourceMapSetting = 'unset';
|
|
319
|
+
validateDifferentSourceMapSettings({
|
|
320
|
+
nuxtSettingKey: 'sourcemap.server',
|
|
321
|
+
nuxtSettingValue: nuxtSourceMap,
|
|
322
|
+
otherSettingKey: settingKey,
|
|
323
|
+
otherSettingValue: nitroRollupSourceMap,
|
|
324
|
+
});
|
|
248
325
|
}
|
|
249
326
|
|
|
250
327
|
nitroConfig.rollupConfig.output.sourcemapExcludeSources = false;
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
328
|
+
if (isDebug) {
|
|
329
|
+
core.consoleSandbox(() => {
|
|
330
|
+
// eslint-disable-next-line no-console
|
|
331
|
+
console.log(
|
|
332
|
+
'[Sentry] Set `sourcemapExcludeSources: false` in the Nuxt config (`nitro.rollupConfig.output`). Source maps will now include the actual code to be able to un-minify code snippets in Sentry.',
|
|
333
|
+
);
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
}
|
|
257
337
|
|
|
258
|
-
|
|
338
|
+
function validateDifferentSourceMapSettings({
|
|
339
|
+
nuxtSettingKey,
|
|
340
|
+
nuxtSettingValue,
|
|
341
|
+
otherSettingKey,
|
|
342
|
+
otherSettingValue,
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
) {
|
|
346
|
+
if (nuxtSettingValue !== otherSettingValue) {
|
|
347
|
+
core.consoleSandbox(() => {
|
|
348
|
+
// eslint-disable-next-line no-console
|
|
349
|
+
console.warn(
|
|
350
|
+
`[Sentry] Source map generation settings are conflicting. Sentry uses \`${nuxtSettingKey}: ${nuxtSettingValue}\`. However, a conflicting setting was discovered (\`${otherSettingKey}: ${otherSettingValue}\`). This setting was probably explicitly set in your configuration. Sentry won't override this setting but it may affect source maps generation and upload. Without source maps, code snippets on the Sentry Issues page will remain minified.`,
|
|
351
|
+
);
|
|
352
|
+
});
|
|
353
|
+
}
|
|
259
354
|
}
|
|
260
355
|
|
|
261
|
-
function
|
|
356
|
+
function logKeepEnabledSourceMapSetting(
|
|
262
357
|
sentryNuxtModuleOptions,
|
|
263
358
|
settingKey,
|
|
264
359
|
settingValue,
|
|
@@ -267,7 +362,7 @@ function logKeepSourceMapSetting(
|
|
|
267
362
|
core.consoleSandbox(() => {
|
|
268
363
|
// eslint-disable-next-line no-console
|
|
269
364
|
console.log(
|
|
270
|
-
`[Sentry]
|
|
365
|
+
`[Sentry] \`${settingKey}\` is enabled with \`${settingValue}\`. This will correctly un-minify the code snippet on the Sentry Issue Details page.`,
|
|
271
366
|
);
|
|
272
367
|
});
|
|
273
368
|
}
|
|
@@ -275,23 +370,23 @@ function logKeepSourceMapSetting(
|
|
|
275
370
|
|
|
276
371
|
function warnExplicitlyDisabledSourceMap(settingKey) {
|
|
277
372
|
core.consoleSandbox(() => {
|
|
278
|
-
//
|
|
373
|
+
// eslint-disable-next-line no-console
|
|
279
374
|
console.warn(
|
|
280
|
-
`[Sentry]
|
|
375
|
+
`[Sentry] We discovered \`${settingKey}\` is set to \`false\`. This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \`${settingKey}\` (e.g. by setting them to \`'hidden'\`).`,
|
|
281
376
|
);
|
|
282
377
|
});
|
|
283
378
|
}
|
|
284
379
|
|
|
285
380
|
function logSentryEnablesSourceMap(settingKey, settingValue) {
|
|
286
381
|
core.consoleSandbox(() => {
|
|
287
|
-
//
|
|
382
|
+
// eslint-disable-next-line no-console
|
|
288
383
|
console.log(`[Sentry] Enabled source map generation in the build options with \`${settingKey}: ${settingValue}\`.`);
|
|
289
384
|
});
|
|
290
385
|
}
|
|
291
386
|
|
|
292
387
|
exports.changeNuxtSourceMapSettings = changeNuxtSourceMapSettings;
|
|
293
|
-
exports.
|
|
294
|
-
exports.changeViteSourceMapSettings = changeViteSourceMapSettings;
|
|
388
|
+
exports.extractNuxtSourceMapSetting = extractNuxtSourceMapSetting;
|
|
295
389
|
exports.getPluginOptions = getPluginOptions;
|
|
296
390
|
exports.setupSourceMaps = setupSourceMaps;
|
|
391
|
+
exports.validateNitroSourceMapSettings = validateNitroSourceMapSettings;
|
|
297
392
|
//# sourceMappingURL=sourceMaps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { consoleSandbox } from '@sentry/core';\nimport { type SentryRollupPluginOptions, sentryRollupPlugin } from '@sentry/rollup-plugin';\nimport { type SentryVitePluginOptions, sentryVitePlugin } from '@sentry/vite-plugin';\nimport type { NitroConfig } from 'nitropack';\nimport type { OutputOptions } from 'rollup';\nimport type { SentryNuxtModuleOptions } from '../common/types';\n\n/**\n * Whether the user enabled (true, 'hidden', 'inline') or disabled (false) source maps\n */\nexport type UserSourceMapSetting = 'enabled' | 'disabled' | 'unset' | undefined;\n\n/**\n * Setup source maps for Sentry inside the Nuxt module during build time (in Vite for Nuxt and Rollup for Nitro).\n */\nexport function setupSourceMaps(moduleOptions: SentryNuxtModuleOptions, nuxt: Nuxt): void {\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n const sourceMapsEnabled = sourceMapsUploadOptions.enabled ?? true;\n\n nuxt.hook('modules:done', () => {\n if (sourceMapsEnabled && !nuxt.options.dev) {\n changeNuxtSourceMapSettings(nuxt, moduleOptions);\n }\n });\n\n nuxt.hook('vite:extendConfig', async (viteConfig, _env) => {\n if (sourceMapsEnabled && viteConfig.mode !== 'development') {\n const previousUserSourceMapSetting = changeViteSourceMapSettings(viteConfig, moduleOptions);\n\n // Add Sentry plugin\n viteConfig.plugins = viteConfig.plugins || [];\n viteConfig.plugins.push(\n sentryVitePlugin(getPluginOptions(moduleOptions, previousUserSourceMapSetting === 'unset')),\n );\n }\n });\n\n nuxt.hook('nitro:config', (nitroConfig: NitroConfig) => {\n if (sourceMapsEnabled && !nitroConfig.dev) {\n if (!nitroConfig.rollupConfig) {\n nitroConfig.rollupConfig = {};\n }\n\n if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === undefined) {\n nitroConfig.rollupConfig.plugins = [];\n } else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {\n // `rollupConfig.plugins` can be a single plugin, so we want to put it into an array so that we can push our own plugin\n nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];\n }\n\n const previousUserSourceMapSetting = changeRollupSourceMapSettings(nitroConfig, moduleOptions);\n\n // Add Sentry plugin\n nitroConfig.rollupConfig.plugins.push(\n sentryRollupPlugin(getPluginOptions(moduleOptions, previousUserSourceMapSetting === 'unset')),\n );\n }\n });\n}\n\n/**\n * Normalizes the beginning of a path from e.g. ../../../ to ./\n */\nfunction normalizePath(path: string): string {\n return path.replace(/^(\\.\\.\\/)+/, './');\n}\n\n/**\n * Generates source maps upload options for the Sentry Vite and Rollup plugin.\n *\n * Only exported for Testing purposes.\n */\nexport function getPluginOptions(\n moduleOptions: SentryNuxtModuleOptions,\n deleteFilesAfterUpload: boolean,\n): SentryVitePluginOptions | SentryRollupPluginOptions {\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n\n if (typeof sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload === 'undefined' && deleteFilesAfterUpload) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Setting `sentry.sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload: [\".*/**/public/**/*.map\"]` to delete generated source maps after they were uploaded to Sentry.',\n );\n });\n }\n\n return {\n org: sourceMapsUploadOptions.org ?? process.env.SENTRY_ORG,\n project: sourceMapsUploadOptions.project ?? process.env.SENTRY_PROJECT,\n authToken: sourceMapsUploadOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n telemetry: sourceMapsUploadOptions.telemetry ?? true,\n url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,\n debug: moduleOptions.debug ?? false,\n silent: sourceMapsUploadOptions.silent ?? false,\n errorHandler: sourceMapsUploadOptions.errorHandler,\n release: {\n name: sourceMapsUploadOptions.release?.name,\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.release,\n },\n _metaOptions: {\n telemetry: {\n metaFramework: 'nuxt',\n },\n },\n ...moduleOptions?.unstable_sentryBundlerPluginOptions,\n\n sourcemaps: {\n // The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')\n // We cannot determine automatically how the build folder looks like (depends on the preset), so we have to accept that source maps are uploaded multiple times (with the vitePlugin for Nuxt and the rollupPlugin for Nitro).\n // If we could know where the server/client assets are located, we could do something like this (based on the Nitro preset): isNitro ? ['./.output/server/**/*'] : ['./.output/public/**/*'],\n assets: sourceMapsUploadOptions.sourcemaps?.assets ?? undefined,\n ignore: sourceMapsUploadOptions.sourcemaps?.ignore ?? undefined,\n filesToDeleteAfterUpload: sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n ? sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n : deleteFilesAfterUpload\n ? ['.*/**/public/**/*.map']\n : undefined,\n rewriteSources: (source: string) => normalizePath(source),\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.sourcemaps,\n },\n };\n}\n\n/* There are 3 ways to set up source maps (https://github.com/getsentry/sentry-javascript/issues/13993)\n 1. User explicitly disabled source maps\n - keep this setting (emit a warning that errors won't be unminified in Sentry)\n - We will not upload anything\n 2. users enabled source map generation (true, hidden, inline).\n - keep this setting (don't do anything - like deletion - besides uploading)\n 3. users did not set source maps generation\n - we enable 'hidden' source maps generation\n - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n\n Nuxt has 3 places to set source maps: vite options, rollup options, nuxt itself\n Ideally, all 3 are enabled to get all source maps.\n */\n\n/** only exported for testing */\nexport function changeNuxtSourceMapSettings(\n nuxt: Nuxt,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): { client: UserSourceMapSetting; server: UserSourceMapSetting } {\n nuxt.options.sourcemap = nuxt.options.sourcemap ?? { server: undefined, client: undefined };\n\n let previousUserSourceMapSetting: { client: UserSourceMapSetting; server: UserSourceMapSetting } = {\n client: undefined,\n server: undefined,\n };\n\n const nuxtSourceMap = nuxt.options.sourcemap;\n\n if (typeof nuxtSourceMap === 'string' || typeof nuxtSourceMap === 'boolean' || typeof nuxtSourceMap === 'undefined') {\n switch (nuxtSourceMap) {\n case false:\n warnExplicitlyDisabledSourceMap('sourcemap');\n previousUserSourceMapSetting = { client: 'disabled', server: 'disabled' };\n break;\n\n case 'hidden':\n case true:\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap', (nuxtSourceMap as true).toString());\n previousUserSourceMapSetting = { client: 'enabled', server: 'enabled' };\n break;\n case undefined:\n nuxt.options.sourcemap = { server: 'hidden', client: 'hidden' };\n logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting = { client: 'unset', server: 'unset' };\n break;\n }\n } else {\n if (nuxtSourceMap.client === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.client');\n previousUserSourceMapSetting.client = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.client)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap.client', nuxtSourceMap.client.toString());\n previousUserSourceMapSetting.client = 'enabled';\n } else {\n nuxt.options.sourcemap.client = 'hidden';\n logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n previousUserSourceMapSetting.client = 'unset';\n }\n\n if (nuxtSourceMap.server === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.server');\n previousUserSourceMapSetting.server = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.server)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap.server', nuxtSourceMap.server.toString());\n previousUserSourceMapSetting.server = 'enabled';\n } else {\n nuxt.options.sourcemap.server = 'hidden';\n logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting.server = 'unset';\n }\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** only exported for testing */\nexport function changeViteSourceMapSettings(\n viteConfig: { build?: { sourcemap?: boolean | 'inline' | 'hidden' } },\n sentryModuleOptions: SentryNuxtModuleOptions,\n): UserSourceMapSetting {\n viteConfig.build = viteConfig.build || {};\n const viteSourceMap = viteConfig.build.sourcemap;\n\n let previousUserSourceMapSetting: UserSourceMapSetting;\n\n if (viteSourceMap === false) {\n warnExplicitlyDisabledSourceMap('vite.build.sourcemap');\n previousUserSourceMapSetting = 'disabled';\n } else if (viteSourceMap && ['hidden', 'inline', true].includes(viteSourceMap)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'vite.build.sourcemap', viteSourceMap.toString());\n previousUserSourceMapSetting = 'enabled';\n } else {\n viteConfig.build.sourcemap = 'hidden';\n logSentryEnablesSourceMap('vite.build.sourcemap', 'hidden');\n previousUserSourceMapSetting = 'unset';\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** only exported for testing */\nexport function changeRollupSourceMapSettings(\n nitroConfig: {\n rollupConfig?: {\n output?: {\n sourcemap?: OutputOptions['sourcemap'];\n sourcemapExcludeSources?: OutputOptions['sourcemapExcludeSources'];\n };\n };\n },\n sentryModuleOptions: SentryNuxtModuleOptions,\n): UserSourceMapSetting {\n nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};\n nitroConfig.rollupConfig.output = nitroConfig.rollupConfig.output || { sourcemap: undefined };\n\n let previousUserSourceMapSetting: UserSourceMapSetting;\n\n const nitroSourceMap = nitroConfig.rollupConfig.output.sourcemap;\n\n if (nitroSourceMap === false) {\n warnExplicitlyDisabledSourceMap('nitro.rollupConfig.output.sourcemap');\n previousUserSourceMapSetting = 'disabled';\n } else if (nitroSourceMap && ['hidden', 'inline', true].includes(nitroSourceMap)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'nitro.rollupConfig.output.sourcemap', nitroSourceMap.toString());\n previousUserSourceMapSetting = 'enabled';\n } else {\n nitroConfig.rollupConfig.output.sourcemap = 'hidden';\n logSentryEnablesSourceMap('nitro.rollupConfig.output.sourcemap', 'hidden');\n previousUserSourceMapSetting = 'unset';\n }\n\n nitroConfig.rollupConfig.output.sourcemapExcludeSources = false;\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Disabled source map setting in the Nuxt config: `nitro.rollupConfig.output.sourcemapExcludeSources`. Source maps will include the actual code to be able to un-minify code snippets in Sentry.',\n );\n });\n\n return previousUserSourceMapSetting;\n}\n\nfunction logKeepSourceMapSetting(\n sentryNuxtModuleOptions: SentryNuxtModuleOptions,\n settingKey: string,\n settingValue: string,\n): void {\n if (sentryNuxtModuleOptions.debug) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We discovered \\`${settingKey}\\` is set to \\`${settingValue}\\`. Sentry will keep this source map setting. This will un-minify the code snippet on the Sentry Issue page.`,\n );\n });\n }\n}\n\nfunction warnExplicitlyDisabledSourceMap(settingKey: string): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Parts of source map generation are currently disabled in your Nuxt configuration (\\`${settingKey}: false\\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`hidden\\`).`,\n );\n });\n}\n\nfunction logSentryEnablesSourceMap(settingKey: string, settingValue: string): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(`[Sentry] Enabled source map generation in the build options with \\`${settingKey}: ${settingValue}\\`.`);\n });\n}\n"],"names":["sentryVitePlugin","sentryRollupPlugin","consoleSandbox"],"mappings":";;;;;;AAQA;AACA;AACA;;AAGA;AACA;AACA;AACO,SAAS,eAAe,CAAC,aAAa,EAA2B,IAAI,EAAc;AAC1F,EAAE,MAAM,0BAA0B,aAAa,CAAC,uBAAwB,IAAG,EAAE;AAC7E,EAAE,MAAM,iBAAkB,GAAE,uBAAuB,CAAC,OAAA,IAAW,IAAI;;AAEnE,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM;AAClC,IAAI,IAAI,iBAAA,IAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAChD,MAAM,2BAA2B,CAAC,IAAI,EAAE,aAAa,CAAC;AACtD;AACA,GAAG,CAAC;;AAEJ,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,UAAU,EAAE,IAAI,KAAK;AAC7D,IAAI,IAAI,iBAAkB,IAAG,UAAU,CAAC,IAAA,KAAS,aAAa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EAAE,YAAY;AACd,EAAQ;AACR,EAAE,IAAI,uBAAuB,CAAC,KAAK,EAAE;AACrC,IAAIA,mBAAc,CAAC,MAAM;AACzB;AACA,MAAM,OAAO,CAAC,GAAG;AACjB,QAAQ,CAAC,yBAAyB,EAAE,UAAU,CAAC,eAAe,EAAE,YAAY,CAAC,4GAA4G,CAAC;AAC1L,OAAO;AACP,KAAK,CAAC;AACN;AACA;;AAEA,SAAS,+BAA+B,CAAC,UAAU,EAAgB;AACnE,EAAEA,mBAAc,CAAC,MAAM;AACvB;AACA,IAAI,OAAO,CAAC,IAAI;AAChB,MAAM,CAAC,6FAA6F,EAAE,UAAU,CAAC,0QAA0Q,EAAE,UAAU,CAAC,wCAAwC,CAAC;AACjb,KAAK;AACL,GAAG,CAAC;AACJ;;AAEA,SAAS,yBAAyB,CAAC,UAAU,EAAU,YAAY,EAAgB;AACnF,EAAEA,mBAAc,CAAC,MAAM;AACvB;AACA,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,mEAAmE,EAAE,UAAU,CAAC,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;AACvH,GAAG,CAAC;AACJ;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { consoleSandbox } from '@sentry/core';\nimport { type SentryRollupPluginOptions, sentryRollupPlugin } from '@sentry/rollup-plugin';\nimport { type SentryVitePluginOptions, sentryVitePlugin } from '@sentry/vite-plugin';\nimport type { NitroConfig } from 'nitropack';\nimport type { SentryNuxtModuleOptions } from '../common/types';\n\n/**\n * Whether the user enabled (true, 'hidden', 'inline') or disabled (false) source maps\n */\nexport type UserSourceMapSetting = 'enabled' | 'disabled' | 'unset' | undefined;\n\n/** A valid source map setting */\nexport type SourceMapSetting = boolean | 'hidden' | 'inline';\n\n/**\n * Setup source maps for Sentry inside the Nuxt module during build time (in Vite for Nuxt and Rollup for Nitro).\n */\nexport function setupSourceMaps(moduleOptions: SentryNuxtModuleOptions, nuxt: Nuxt): void {\n const isDebug = moduleOptions.debug;\n\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n const sourceMapsEnabled = sourceMapsUploadOptions.enabled ?? true;\n\n // In case we overwrite the source map settings, we default to deleting the files\n let shouldDeleteFilesFallback = { client: true, server: true };\n\n nuxt.hook('modules:done', () => {\n if (sourceMapsEnabled && !nuxt.options.dev) {\n // Changing this setting will propagate:\n // - for client to viteConfig.build.sourceMap\n // - for server to viteConfig.build.sourceMap and nitro.sourceMap\n // On server, nitro.rollupConfig.output.sourcemap remains unaffected from this change.\n\n // ONLY THIS nuxt.sourcemap.(server/client) setting is the one Sentry will eventually overwrite with 'hidden'\n const previousSourceMapSettings = changeNuxtSourceMapSettings(nuxt, moduleOptions);\n\n shouldDeleteFilesFallback = {\n client: previousSourceMapSettings.client === 'unset',\n server: previousSourceMapSettings.server === 'unset',\n };\n\n if (\n isDebug &&\n !sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload &&\n (shouldDeleteFilesFallback.client || shouldDeleteFilesFallback.server)\n ) {\n consoleSandbox(() =>\n // eslint-disable-next-line no-console\n console.log(\n \"[Sentry] As Sentry enabled `'hidden'` source maps, source maps will be automatically deleted after uploading them to Sentry.\",\n ),\n );\n }\n }\n });\n\n nuxt.hook('vite:extendConfig', async (viteConfig, env) => {\n if (sourceMapsEnabled && viteConfig.mode !== 'development') {\n const runtime = env.isServer ? 'server' : env.isClient ? 'client' : undefined;\n const nuxtSourceMapSetting = extractNuxtSourceMapSetting(nuxt, runtime);\n\n viteConfig.build = viteConfig.build || {};\n const viteSourceMap = viteConfig.build.sourcemap;\n\n // Vite source map options are the same as the Nuxt source map config options (unless overwritten)\n validateDifferentSourceMapSettings({\n nuxtSettingKey: `sourcemap.${runtime}`,\n nuxtSettingValue: nuxtSourceMapSetting,\n otherSettingKey: 'viteConfig.build.sourcemap',\n otherSettingValue: viteSourceMap,\n });\n\n if (isDebug) {\n consoleSandbox(() => {\n if (!runtime) {\n // eslint-disable-next-line no-console\n console.log(\"[Sentry] Cannot detect runtime (client/server) inside hook 'vite:extendConfig'.\");\n } else {\n // eslint-disable-next-line no-console\n console.log(`[Sentry] Adding Sentry Vite plugin to the ${runtime} runtime.`);\n }\n });\n }\n\n // Add Sentry plugin\n // Vite plugin is added on the client and server side (hook runs twice)\n // Nuxt client source map is 'false' by default. Warning about this will be shown already in an earlier step, and it's also documented that `nuxt.sourcemap.client` needs to be enabled.\n viteConfig.plugins = viteConfig.plugins || [];\n viteConfig.plugins.push(sentryVitePlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)));\n }\n });\n\n nuxt.hook('nitro:config', (nitroConfig: NitroConfig) => {\n if (sourceMapsEnabled && !nitroConfig.dev) {\n if (!nitroConfig.rollupConfig) {\n nitroConfig.rollupConfig = {};\n }\n\n if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === undefined) {\n nitroConfig.rollupConfig.plugins = [];\n } else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {\n // `rollupConfig.plugins` can be a single plugin, so we want to put it into an array so that we can push our own plugin\n nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];\n }\n\n validateNitroSourceMapSettings(nuxt, nitroConfig, moduleOptions);\n\n if (isDebug) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log('[Sentry] Adding Sentry Rollup plugin to the server runtime.');\n });\n }\n\n // Add Sentry plugin\n // Runs only on server-side (Nitro)\n nitroConfig.rollupConfig.plugins.push(\n sentryRollupPlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)),\n );\n }\n });\n}\n\n/**\n * Normalizes the beginning of a path from e.g. ../../../ to ./\n */\nfunction normalizePath(path: string): string {\n return path.replace(/^(\\.\\.\\/)+/, './');\n}\n\n/**\n * Generates source maps upload options for the Sentry Vite and Rollup plugin.\n *\n * Only exported for Testing purposes.\n */\nexport function getPluginOptions(\n moduleOptions: SentryNuxtModuleOptions,\n shouldDeleteFilesFallback?: { client: boolean; server: boolean },\n): SentryVitePluginOptions | SentryRollupPluginOptions {\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n\n const shouldDeleteFilesAfterUpload = shouldDeleteFilesFallback?.client || shouldDeleteFilesFallback?.server;\n const fallbackFilesToDelete = [\n ...(shouldDeleteFilesFallback?.client ? ['.*/**/public/**/*.map'] : []),\n ...(shouldDeleteFilesFallback?.server\n ? ['.*/**/server/**/*.map', '.*/**/output/**/*.map', '.*/**/function/**/*.map']\n : []),\n ];\n\n if (\n typeof sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload === 'undefined' &&\n shouldDeleteFilesAfterUpload\n ) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Setting \\`sentry.sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload: [${fallbackFilesToDelete\n // Logging it as strings in the array\n .map(path => `\"${path}\"`)\n .join(', ')}]\\` to delete generated source maps after they were uploaded to Sentry.`,\n );\n });\n }\n\n return {\n org: sourceMapsUploadOptions.org ?? process.env.SENTRY_ORG,\n project: sourceMapsUploadOptions.project ?? process.env.SENTRY_PROJECT,\n authToken: sourceMapsUploadOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n telemetry: sourceMapsUploadOptions.telemetry ?? true,\n url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,\n debug: moduleOptions.debug ?? false,\n silent: sourceMapsUploadOptions.silent ?? false,\n errorHandler: sourceMapsUploadOptions.errorHandler,\n release: {\n name: sourceMapsUploadOptions.release?.name,\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.release,\n },\n _metaOptions: {\n telemetry: {\n metaFramework: 'nuxt',\n },\n },\n ...moduleOptions?.unstable_sentryBundlerPluginOptions,\n\n sourcemaps: {\n // The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')\n // We cannot determine automatically how the build folder looks like (depends on the preset), so we have to accept that source maps are uploaded multiple times (with the vitePlugin for Nuxt and the rollupPlugin for Nitro).\n // If we could know where the server/client assets are located, we could do something like this (based on the Nitro preset): isNitro ? ['./.output/server/**/*'] : ['./.output/public/**/*'],\n assets: sourceMapsUploadOptions.sourcemaps?.assets ?? undefined,\n ignore: sourceMapsUploadOptions.sourcemaps?.ignore ?? undefined,\n filesToDeleteAfterUpload: sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n ? sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n : shouldDeleteFilesFallback?.server || shouldDeleteFilesFallback?.client\n ? fallbackFilesToDelete\n : undefined,\n rewriteSources: (source: string) => normalizePath(source),\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.sourcemaps,\n },\n };\n}\n\n/* There are multiple ways to set up source maps (https://github.com/getsentry/sentry-javascript/issues/13993 and https://github.com/getsentry/sentry-javascript/pull/15859)\n 1. User explicitly disabled source maps\n - keep this setting (emit a warning that errors won't be unminified in Sentry)\n - We will not upload anything\n 2. users enabled source map generation (true, hidden, inline).\n - keep this setting (don't do anything - like deletion - besides uploading)\n 3. users did not set source maps generation\n - we enable 'hidden' source maps generation\n - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n\n Users only have to explicitly enable client source maps. Sentry only overwrites the base Nuxt source map settings as they propagate.\n */\n\n/** only exported for tests */\nexport function extractNuxtSourceMapSetting(\n nuxt: { options: { sourcemap?: SourceMapSetting | { server?: SourceMapSetting; client?: SourceMapSetting } } },\n runtime: 'client' | 'server' | undefined,\n): SourceMapSetting | undefined {\n if (!runtime) {\n return undefined;\n } else {\n return typeof nuxt.options?.sourcemap === 'boolean' || typeof nuxt.options?.sourcemap === 'string'\n ? nuxt.options.sourcemap\n : nuxt.options?.sourcemap?.[runtime];\n }\n}\n\n/** only exported for testing */\nexport function changeNuxtSourceMapSettings(\n nuxt: Nuxt,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): { client: UserSourceMapSetting; server: UserSourceMapSetting } {\n nuxt.options.sourcemap = nuxt.options.sourcemap ?? { server: undefined, client: undefined };\n\n let previousUserSourceMapSetting: { client: UserSourceMapSetting; server: UserSourceMapSetting } = {\n client: undefined,\n server: undefined,\n };\n\n const nuxtSourceMap = nuxt.options.sourcemap;\n\n if (typeof nuxtSourceMap === 'string' || typeof nuxtSourceMap === 'boolean' || typeof nuxtSourceMap === 'undefined') {\n switch (nuxtSourceMap) {\n case false:\n warnExplicitlyDisabledSourceMap('sourcemap');\n previousUserSourceMapSetting = { client: 'disabled', server: 'disabled' };\n break;\n\n case 'hidden':\n case true:\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap', (nuxtSourceMap as true).toString());\n previousUserSourceMapSetting = { client: 'enabled', server: 'enabled' };\n break;\n case undefined:\n nuxt.options.sourcemap = { server: 'hidden', client: 'hidden' };\n logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting = { client: 'unset', server: 'unset' };\n break;\n }\n } else {\n if (nuxtSourceMap.client === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.client');\n previousUserSourceMapSetting.client = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.client)) {\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.client', nuxtSourceMap.client.toString());\n previousUserSourceMapSetting.client = 'enabled';\n } else {\n nuxt.options.sourcemap.client = 'hidden';\n logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n previousUserSourceMapSetting.client = 'unset';\n }\n\n if (nuxtSourceMap.server === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.server');\n previousUserSourceMapSetting.server = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.server)) {\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.server', nuxtSourceMap.server.toString());\n previousUserSourceMapSetting.server = 'enabled';\n } else {\n nuxt.options.sourcemap.server = 'hidden';\n logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting.server = 'unset';\n }\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** Logs warnings about potentially conflicting source map settings.\n * Configures `sourcemapExcludeSources` in Nitro to make source maps usable in Sentry.\n *\n * only exported for testing\n */\nexport function validateNitroSourceMapSettings(\n nuxt: { options: { sourcemap?: SourceMapSetting | { server?: SourceMapSetting } } },\n nitroConfig: NitroConfig,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): void {\n const isDebug = sentryModuleOptions.debug;\n const nuxtSourceMap = extractNuxtSourceMapSetting(nuxt, 'server');\n\n // NITRO CONFIG ---\n\n validateDifferentSourceMapSettings({\n nuxtSettingKey: 'sourcemap.server',\n nuxtSettingValue: nuxtSourceMap,\n otherSettingKey: 'nitro.sourceMap',\n otherSettingValue: nitroConfig.sourceMap,\n });\n\n // ROLLUP CONFIG ---\n\n nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};\n nitroConfig.rollupConfig.output = nitroConfig.rollupConfig.output || { sourcemap: undefined };\n const nitroRollupSourceMap = nitroConfig.rollupConfig.output.sourcemap;\n\n // We don't override nitro.rollupConfig.output.sourcemap (undefined by default, but overrides all other server-side source map settings)\n if (typeof nitroRollupSourceMap !== 'undefined' && ['hidden', 'inline', true, false].includes(nitroRollupSourceMap)) {\n const settingKey = 'nitro.rollupConfig.output.sourcemap';\n\n validateDifferentSourceMapSettings({\n nuxtSettingKey: 'sourcemap.server',\n nuxtSettingValue: nuxtSourceMap,\n otherSettingKey: settingKey,\n otherSettingValue: nitroRollupSourceMap,\n });\n }\n\n nitroConfig.rollupConfig.output.sourcemapExcludeSources = false;\n if (isDebug) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Set `sourcemapExcludeSources: false` in the Nuxt config (`nitro.rollupConfig.output`). Source maps will now include the actual code to be able to un-minify code snippets in Sentry.',\n );\n });\n }\n}\n\nfunction validateDifferentSourceMapSettings({\n nuxtSettingKey,\n nuxtSettingValue,\n otherSettingKey,\n otherSettingValue,\n}: {\n nuxtSettingKey: string;\n nuxtSettingValue?: SourceMapSetting;\n otherSettingKey: string;\n otherSettingValue?: SourceMapSetting;\n}): void {\n if (nuxtSettingValue !== otherSettingValue) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation settings are conflicting. Sentry uses \\`${nuxtSettingKey}: ${nuxtSettingValue}\\`. However, a conflicting setting was discovered (\\`${otherSettingKey}: ${otherSettingValue}\\`). This setting was probably explicitly set in your configuration. Sentry won't override this setting but it may affect source maps generation and upload. Without source maps, code snippets on the Sentry Issues page will remain minified.`,\n );\n });\n }\n}\n\nfunction logKeepEnabledSourceMapSetting(\n sentryNuxtModuleOptions: SentryNuxtModuleOptions,\n settingKey: string,\n settingValue: string,\n): void {\n if (sentryNuxtModuleOptions.debug) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] \\`${settingKey}\\` is enabled with \\`${settingValue}\\`. This will correctly un-minify the code snippet on the Sentry Issue Details page.`,\n );\n });\n }\n}\n\nfunction warnExplicitlyDisabledSourceMap(settingKey: string): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] We discovered \\`${settingKey}\\` is set to \\`false\\`. This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`'hidden'\\`).`,\n );\n });\n}\n\nfunction logSentryEnablesSourceMap(settingKey: string, settingValue: string): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(`[Sentry] Enabled source map generation in the build options with \\`${settingKey}: ${settingValue}\\`.`);\n });\n}\n"],"names":["consoleSandbox","sentryVitePlugin","sentryRollupPlugin"],"mappings":";;;;;;AAOA;AACA;AACA;;AAMA;AACA;AACA;AACO,SAAS,eAAe,CAAC,a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