File tree Expand file tree Collapse file tree 4 files changed +25
-5
lines changed Expand file tree Collapse file tree 4 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,10 @@ function initSDK() {
117
117
Sentry . init ( {
118
118
dsn : 'https://public@example.com/1' ,
119
119
// debug: true,
120
- integrations : [ new SentryIntegration . Dedupe ( ) ] ,
120
+ integrations : [
121
+ ( Sentry . Integrations && Sentry . Integrations . Dedupe && new Sentry . Integrations . Dedupe ( ) ) ||
122
+ ( SentryIntegrations && new SentryIntegrations . Dedupe ( ) ) ,
123
+ ] ,
121
124
attachStacktrace : true ,
122
125
transport : DummyTransport ,
123
126
ignoreErrors : [ 'ignoreErrorTest' ] ,
Original file line number Diff line number Diff line change 6
6
< title > </ title >
7
7
< script src ="polyfills/es6-promise-4.2.5.auto.js "> </ script >
8
8
< script src ="polyfills/whatwg-fetch-3.0.0.js "> </ script >
9
- < script src ="dedupe.js "> </ script >
10
9
< script src ="common.js "> </ script >
11
10
< script src ="../../build/bundle.js "> </ script >
11
+ < script src ="dedupe.js "> </ script >
12
12
< script src ="init.js "> </ script >
13
13
</ head >
14
14
Original file line number Diff line number Diff line change 1
1
const Sentry = require ( '../../dist/index.js' ) ;
2
+ const Integrations = require ( '../../../integrations/dist/dedupe.js' ) ;
2
3
3
4
// Init
4
5
Sentry . init ( {
5
6
dsn : 'https://completelyrandom@dsn.asdf/42' ,
7
+ integrations : [ new Integrations . Dedupe ( ) ] ,
6
8
beforeSend ( event ) {
7
9
console . log ( 'Got an event' ) ;
8
10
return null ;
Original file line number Diff line number Diff line change @@ -53,12 +53,27 @@ function toPascalCase(string) {
53
53
}
54
54
55
55
function mergeIntoSentry ( name ) {
56
- return `window.SentryIntegration = window.SentryIntegration || {}; \n
57
- window.SentryIntegration.${ name } = exports.${ name } ;` ;
56
+ return `
57
+ if (window.Sentry && window.Sentry.Integrations) {
58
+ window.Sentry.Integrations['${ name } '] = exports.${ name } ;
59
+ } else {
60
+ if ((typeof __SENTRY_INTEGRATIONS_LOG === 'undefined')) {
61
+ console.warn('Sentry.Integrations is not defined, make sure you included this script after the SDK.');
62
+ console.warn('In case you were using the loader, we added the Integration is now available under SentryIntegrations.${ name } ');
63
+ console.warn('To disable these warning set __SENTRY_INTEGRATIONS_LOG = true; somewhere before loading this script.');
64
+ }
65
+ window.SentryIntegrations = window.SentryIntegrations || {};
66
+ window.SentryIntegrations['${ name } '] = exports.${ name } ;
67
+ }
68
+ ` ;
69
+ }
70
+
71
+ function allIntegrations ( ) {
72
+ return fs . readdirSync ( './src' ) . filter ( file => file != 'modules.ts' ) ;
58
73
}
59
74
60
75
function loadAllIntegrations ( ) {
61
- return fs . readdirSync ( './src' ) . map ( file => ( {
76
+ return allIntegrations ( ) . map ( file => ( {
62
77
input : `src/${ file } ` ,
63
78
output : {
64
79
banner : '(function (window) {' ,
You can’t perform that action at this time.
0 commit comments