Closed rchl closed 1 year ago
The import * as Sentry from '~@sentry/vue' has prevented tree shaking from working.
import * as Sentry from '~@sentry/vue'
This results in about 221KB reduction when using tracing and a bit less when not using tracing (that's weird, yes, but looks like related to Sentry SDK itself).
tracing
Unfortunately it doesn't benefit when using lazy loading. Maybe there is a way to handle it using webpack's magic comments in https://github.com/nuxt-community/sentry-module/blob/994f333a8dfbc8cb4ecefbbc8042752d804b7f64/src/templates/plugin.lazy.js#L112-L112 but I haven't investigated at that point.
lazy
EDIT: There is a webpack magic comment webpackExports but it's only available from webpack 5.
webpackExports
The
import * as Sentry from '~@sentry/vue'
has prevented tree shaking from working.This results in about 221KB reduction when using
tracing
and a bit less when not usingtracing
(that's weird, yes, but looks like related to Sentry SDK itself).Unfortunately it doesn't benefit when using
lazy
loading. Maybe there is a way to handle it using webpack's magic comments in https://github.com/nuxt-community/sentry-module/blob/994f333a8dfbc8cb4ecefbbc8042752d804b7f64/src/templates/plugin.lazy.js#L112-L112 but I haven't investigated at that point.EDIT: There is a webpack magic comment
webpackExports
but it's only available from webpack 5.