Vue.js: Use Sentry.io without increasing initial bundle size
There's no questions about it: in the age of "fat" frontend clients, less bloat is better.
A useful technique is to split off large libraries into separate Webpack chunks so the they don't take up space in your main bundle, delaying the initial load of your webapp.
I like doing this with what I call the "installer pattern". Every split-out library gets its own "installer", an async function that loads the Webpack chunk, performs any initializations or configuration necessary, and then informs the relevant parts of your app that loading has completed.
Here's what that pattern looks like for installing the Sentry.io error reporting SDK:
First, add Sentry to your project: