1
- import VueLib from 'vue'
1
+ import Vue from 'vue'
2
2
3
3
< % if ( options . lazy . injectMock ) { % >
4
4
/* eslint-enable object-curly-spacing, quote-props, quotes, key-spacing, comma-spacing */
@@ -20,16 +20,16 @@ const delayUnhandledRejection = function (event) {
20
20
delayedUnhandledRejections . push ( 'reason' in event ? event . reason : 'detail' in event && 'reason' in event . detail ? event . detail . reason : event )
21
21
}
22
22
23
- const vueErrorHandler = VueLib . config . errorHandler
23
+ const vueErrorHandler = Vue . config . errorHandler
24
24
25
- VueLib . config . errorHandler = ( error , vm , info ) => {
25
+ Vue . config . errorHandler = ( error , vm , info ) => {
26
26
if ( ! loadCompleted ) {
27
27
if ( vm ) {
28
28
vm . $sentry . captureException ( error )
29
29
}
30
30
31
- if ( VueLib . util ) {
32
- VueLib . util . warn ( `Error in ${ info } : "${ error . toString ( ) } "` , vm )
31
+ if ( Vue . util ) {
32
+ Vue . util . warn ( `Error in ${ info } : "${ error . toString ( ) } "` , vm )
33
33
}
34
34
console . error ( error )
35
35
}
@@ -119,10 +119,24 @@ async function loadSentry (ctx, inject) {
119
119
integrations = options . BROWSER_INTEGRATIONS . filter ( key => key in options . integrations )
120
120
if ( integrations . length ) { % > const { < %= integrations . join ( ', ' ) % > } = Sentry . Integrations
121
121
< % }
122
+
123
+ const serializedConfig = Object
124
+ . entries ( {
125
+ ...options . config ,
126
+ ...options . integrations . Vue ,
127
+ ...( options . tracing ? options . tracing . vueOptions . tracingOptions : { } ) ,
128
+ } )
129
+ . map ( ( [ key , option ] ) => {
130
+ const value = typeof option === 'function' ? serializeFunction ( option ) : serialize ( option )
131
+ return `${ key } : ${ value } `
132
+ } )
133
+ . join ( ',\n ' )
122
134
% >
123
135
/* eslint-disable object-curly-spacing, quote-props, quotes, key-spacing, comma-spacing */
124
- const config = < %= serialize ( options . config ) % >
125
- config . Vue = VueLib
136
+ const config = {
137
+ Vue,
138
+ < %= serializedConfig % >
139
+ }
126
140
127
141
const runtimeConfigKey = < %= serialize ( options . runtimeConfigKey ) % >
128
142
if ( ctx . $config && runtimeConfigKey && ctx . $config [ runtimeConfigKey ] ) {
@@ -131,16 +145,22 @@ async function loadSentry (ctx, inject) {
131
145
}
132
146
133
147
config . integrations = [
134
- < %= Object . entries ( options . integrations ) . map ( ( [ name , integration ] ) => {
135
- const integrationOptions = Object . entries ( integration ) . map ( ( [ key , option ] ) =>
136
- typeof option === 'function'
137
- ? `${ key } :${ serializeFunction ( option ) } `
138
- : `${ key } :${ serialize ( option ) } `
139
- )
140
-
141
- return `new ${ name } (${ integrationOptions . length ? '{' + integrationOptions . join ( ',' ) + '}' : '' } )`
142
- } ) . join ( ',\n ' ) % > ,
148
+ < %= Object
149
+ . entries ( options . integrations )
150
+ . filter ( ( [ name ] ) => name !== 'Vue' )
151
+ . map ( ( [ name , integration ] ) => {
152
+ const integrationOptions = Object
153
+ . entries ( integration )
154
+ . map ( ( [ key , option ] ) => {
155
+ const value = typeof option === 'function' ? serializeFunction ( option ) : serialize ( option )
156
+ return `${ key } :${ value } `
157
+ } )
158
+
159
+ return `new ${ name } (${ integrationOptions . length ? '{' + integrationOptions . join ( ',' ) + '}' : '' } )`
160
+ } ) . join ( ',\n ' )
161
+ % > ,
143
162
]
163
+
144
164
< % if ( options . customClientIntegrations ) { % >
145
165
const customIntegrations = ( await import ( /* <%= magicComments.join(', ') %> */ '<%= options.customClientIntegrations %>' ) . then ( m => m . default || m ) ) ( ctx )
146
166
if ( Array . isArray ( customIntegrations ) ) {
0 commit comments