@@ -125,32 +125,31 @@ export default defineNuxtPlugin({
125
125
function buildIntegrations ( integrationConfig : ClientIntegrationConfig , nuxtApp : _NuxtApp ) {
126
126
const integrations : Integration [ ] = [ ]
127
127
128
- for ( const [ name , options ] of Object . entries (
129
- integrationConfig ,
130
- ) as Entries < ClientIntegrationConfig > ) {
128
+ for ( const [ name , integration ] of Object . entries ( integrationMap ) as Entries <
129
+ typeof integrationMap
130
+ > ) {
131
+ const options = integrationConfig [ name ]
132
+
131
133
// If the integration is disabled, skip it
132
134
if ( options === false ) continue
133
135
134
136
// If the integration hasn't been configured and isn't a default, skip it
135
137
if ( options == null && ! defaultIntegrations . includes ( name ) ) continue
136
138
137
- const integration = integrationMap [ name as ClientIntegrations ]
138
- if ( integration ) {
139
- const integrationOptions = options === true ? undefined : options
140
-
141
- if ( name === "BrowserTracing" ) {
142
- const browserOptions = integrationOptions as BrowserTracingOptions | undefined
143
- integrations . push (
144
- vueBrowserTracingIntegration ( {
145
- ...browserOptions ,
146
- router : nuxtApp . vueApp . $nuxt . $router ,
147
- } ) ,
148
- )
149
- continue
150
- }
151
-
152
- integrations . push ( integration ( options === true ? undefined : options ) )
139
+ const integrationOptions = options === true ? undefined : options
140
+
141
+ if ( name === "BrowserTracing" ) {
142
+ const browserOptions = integrationOptions as BrowserTracingOptions | undefined
143
+ integrations . push (
144
+ vueBrowserTracingIntegration ( {
145
+ ...browserOptions ,
146
+ router : nuxtApp . vueApp . $nuxt . $router ,
147
+ } ) ,
148
+ )
149
+ continue
153
150
}
151
+
152
+ integrations . push ( integration ( options === true ? undefined : options ) )
154
153
}
155
154
156
155
return integrations
0 commit comments