Skip to content

Commit 6eea7da

Browse files
committed
Fix
1 parent 1e3e973 commit 6eea7da

File tree

1 file changed

+4
-4
lines changed
  • packages/bundler-plugin-core/src

1 file changed

+4
-4
lines changed

packages/bundler-plugin-core/src/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)