Skip to content

Commit 573d779

Browse files
committed
fix it
1 parent aeb2be0 commit 573d779

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

dev-packages/rollup-utils/npmHelpers.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
makeImportMetaUrlReplacePlugin,
2020
makeNodeResolvePlugin,
2121
makeRrwebBuildPlugin,
22-
makeSetSDKSourcePlugin,
2322
makeSucrasePlugin,
2423
} from './plugins/index.mjs';
2524
import { makePackageNodeEsm } from './plugins/make-esm-plugin.mjs';
@@ -45,7 +44,6 @@ export function makeBaseNPMConfig(options = {}) {
4544
const importMetaUrlReplacePlugin = makeImportMetaUrlReplacePlugin();
4645
const cleanupPlugin = makeCleanupPlugin();
4746
const extractPolyfillsPlugin = makeExtractPolyfillsPlugin();
48-
const setSdkSourcePlugin = makeSetSDKSourcePlugin('npm');
4947
const rrwebBuildPlugin = makeRrwebBuildPlugin({
5048
excludeShadowDom: undefined,
5149
excludeIframe: undefined,
@@ -106,7 +104,6 @@ export function makeBaseNPMConfig(options = {}) {
106104

107105
plugins: [
108106
nodeResolvePlugin,
109-
setSdkSourcePlugin,
110107
sucrasePlugin,
111108
debugBuildStatementReplacePlugin,
112109
importMetaUrlReplacePlugin,

packages/utils/src/env.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
declare const __SENTRY_BROWSER_BUNDLE__: boolean | undefined;
1717

18+
declare const __SENTRY_SDK_SOURCE__: SdkSource | undefined;
19+
1820
export type SdkSource = 'npm' | 'cdn' | 'loader';
1921

2022
/**
@@ -30,6 +32,5 @@ export function isBrowserBundle(): boolean {
3032
* Get source of SDK.
3133
*/
3234
export function getSDKSource(): SdkSource {
33-
// @ts-expect-error __SENTRY_SDK_SOURCE__ is injected by rollup during build process
34-
return __SENTRY_SDK_SOURCE__;
35+
return typeof __SENTRY_SDK_SOURCE__ !== 'undefined' ? __SENTRY_SDK_SOURCE__ : 'npm';
3536
}

0 commit comments

Comments
 (0)