We're using the sentry-webpack-plugin and that does it's magic during the vue-cli build as that's when all the webpack plugins run.
This means the artifacts that get uploaded for a Sentry release look like (looking at the Sentry dashboard at Settings (for the project, not organisation) -> Source maps -> Archives):
There is a service-worker.js file but it's just a tiny (1.1KB) shell of one that is generated (by the vue-cli I think).
So the problem is that we do the release before we've created the service worker (and its source map). We can't just run rollup before webpack because webpack writes out all the env vars that we need in rollup.
What we can do is stop using the webpack plugin and change to using the sentry-cli. Then we can run sentry-cli at the end and make sure everything is uploaded.
Once service-worker sourcemaps are working, we might be able to add in the terser plugin to minify the service worker. That is assuming the code minifies safely. The plugin would be added in our code here.
Currently our build pipeline when doing a release is here: https://github.com/ternandsparrow/wild-orchid-watch-pwa/blob/0057a54/package.json#L8. The steps we do are:
We're using the sentry-webpack-plugin and that does it's magic during the vue-cli build as that's when all the webpack plugins run.
This means the artifacts that get uploaded for a Sentry release look like (looking at the Sentry dashboard at Settings (for the project, not organisation) -> Source maps -> Archives):
There is a
service-worker.js
file but it's just a tiny (1.1KB) shell of one that is generated (by the vue-cli I think).So the problem is that we do the release before we've created the service worker (and its source map). We can't just run rollup before webpack because webpack writes out all the env vars that we need in rollup.
What we can do is stop using the webpack plugin and change to using the sentry-cli. Then we can run
sentry-cli
at the end and make sure everything is uploaded.