Skip to content

Instantly share code, notes, and snippets.

@zechdc
Created April 14, 2020 22:42
Show Gist options
  • Save zechdc/b03580b9bce9e39fb0e505a310d1b8c9 to your computer and use it in GitHub Desktop.
Save zechdc/b03580b9bce9e39fb0e505a310d1b8c9 to your computer and use it in GitHub Desktop.
// Below is the relevant snippets related to sentry
const SentryCliPlugin = require('@sentry/webpack-plugin');
const EnvConfig = require('./env');
// EnvConfig.SENTRY_ENABLED = true;
function initSourceMaps() {
if (EnvConfig.SENTRY_ENABLED) {
return 'source-map';
}
if (!isProd) {
return 'eval-source-map';
}
return false;
}
module.exports = {
mode: process.env.NODE_ENV,
devtool: initSourceMaps(),
}
// .... more webpack config here
if (EnvConfig.SENTRY_ENABLED) {
module.exports.plugins.push(
new SentryCliPlugin({
include: '../public',
release: EnvConfig.SENTRY_RELEASE_VERSION,
urlPrefix: '~/app/store',
validate: true,
rewrite: true,
}),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment