Best practice for release in webpack project?

with sentry/webpack-plugin, we can set release for code like:
new SentryPlugin({
release: {RELEASE},
is it default to Commit ID? how does a good RELEASE “should” be?
as we know, we alse need to set Raven.js config:

.config(’{DSN}’, {
release: ‘{REEASE}’
another problem is that SentryPlugin and Raven runs in different environments, how can i synchronized these? in especial, how get RELEASE in browser environment if we set RELEASE to be Commit ID refer to a repository?

So yeah, the default is the commit hash, it works best in conjunction with our release system and vcs integrations.
We inject the release version into you built bundle and raven-js picks it up if it’s there, so you shouldn’t have to do anything in order to get correct stack traces.

thx, that’s very helpful. However, I make project been built twice so that i could get two built bundles, one with sourcemap for sentry server (with the help of sentry-webpack-plugin) and the other bundle without sourcemap for CDN:joy:. It seems not graceful and efficient. What’s worse, the release version can’t been injected into bundle of production.
Then I get a a different way, I make project been built one time, then run a script (like: “rimraf build/**/*.map”) to delete map files. I wonder if there is any other ideas?

Hmm, why are you not using the same build and just don’t upload the sourcemaps to your CDN?

Nevertheless, you can always just set your own release, in the webpack plugin and your source code with Raven.setRelease

Make sure both release versions are the same e.g.: 1.2.3 then it should work and you don’t have to use any of our magic.

emm, I got. It is confined to our publish system :joy: , that’s little troublesome.