File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/bundler-plugin-core/src Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -314,8 +314,8 @@ export function generateGlobalInjectorCode({
314
314
} ) {
315
315
// The code below is mostly ternary operators because it saves bundle size.
316
316
// The checks are to support as many environments as possible. (Node.js, Browser, webworkers, etc.)
317
- let code = `(function () {
318
- var _global =
317
+ let code = `{
318
+ const _global =
319
319
typeof window !== 'undefined' ?
320
320
window :
321
321
typeof global !== 'undefined' ?
@@ -335,7 +335,7 @@ export function generateGlobalInjectorCode({
335
335
_global.SENTRY_BUILD_INFO=${ JSON . stringify ( buildInfo ) } ;` ;
336
336
}
337
337
338
- code += '})(); ' ;
338
+ code += '}' ;
339
339
340
340
return code ;
341
341
}
@@ -346,7 +346,7 @@ export function generateModuleMetadataInjectorCode(metadata: any) {
346
346
// The checks are to support as many environments as possible. (Node.js, Browser, webworkers, etc.)
347
347
// We are merging the metadata objects in case modules are bundled twice with the plugin
348
348
return `{
349
- var _sentryModuleMetadataGlobal =
349
+ const _sentryModuleMetadataGlobal =
350
350
typeof window !== "undefined"
351
351
? window
352
352
: typeof global !== "undefined"
You can’t perform that action at this time.
0 commit comments