1 | import VueLib from 'vue'
|
2 | import * as Sentry from '@sentry/browser'
|
3 | import { <%= Object.keys(options.integrations).map(integration => integration).join(', ') %> } from '@sentry/integrations'
|
4 |
|
5 | export default function (ctx, inject) {
|
6 | const opts = Object.assign({}, <%= serialize(options.config) %>, {
|
7 | integrations: [
|
8 | <%= Object.keys(options.integrations).map(name => {
|
9 | const integration = options.integrations[name]
|
10 | if (name === 'Vue') {
|
11 | return `new ${name}({Vue: VueLib, ...${serialize(integration)}})`
|
12 | }
|
13 | return `new ${name}({${Object.keys(integration).map(option => typeof integration[option] === 'function' ?
|
14 | `${option}:${serializeFunction(integration[option])}` : `${option}:${serialize(integration[option])}`).join(',')}})`
|
15 | }).join(',\n ') %>
|
16 | ]
|
17 | })
|
18 |
|
19 | <% if (options.initialize) { %>
|
20 | Sentry.init(opts)<% } %>
|
21 |
|
22 |
|
23 | inject('sentry', Sentry)
|
24 | ctx.$sentry = Sentry
|
25 | }
|