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({
314314} ) {
315315 // The code below is mostly ternary operators because it saves bundle size.
316316 // 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 =
319319 typeof window !== 'undefined' ?
320320 window :
321321 typeof global !== 'undefined' ?
@@ -335,7 +335,7 @@ export function generateGlobalInjectorCode({
335335 _global.SENTRY_BUILD_INFO=${ JSON . stringify ( buildInfo ) } ;` ;
336336 }
337337
338- code += '})(); ' ;
338+ code += '}' ;
339339
340340 return code ;
341341}
@@ -346,7 +346,7 @@ export function generateModuleMetadataInjectorCode(metadata: any) {
346346 // The checks are to support as many environments as possible. (Node.js, Browser, webworkers, etc.)
347347 // We are merging the metadata objects in case modules are bundled twice with the plugin
348348 return `{
349- var _sentryModuleMetadataGlobal =
349+ const _sentryModuleMetadataGlobal =
350350 typeof window !== "undefined"
351351 ? window
352352 : typeof global !== "undefined"
You can’t perform that action at this time.
0 commit comments