ci(sentry): update sentry to use new hosted instance

this might not work but hey it kinda does
This commit is contained in:
Taso committed 2021-07-27 17:06:49 -04:00
1 parent eaae3c7211
commit 44599c882d
8 files changed
+319 -6

No files matched your search

+24
View File
@@ -1,3 +1,4 @@
require('dotenv').config();
const path = require('path');
const {
@@ -8,6 +9,8 @@ const {
throwUnexpectedConfigError,
} = require('@craco/craco');
const SentryCliPlugin = require('@sentry/webpack-plugin');
const throwError = (message) =>
throwUnexpectedConfigError({
packageName: 'craco',
@@ -19,6 +22,27 @@ const throwError = (message) =>
module.exports = {
webpack: {
configure: (webpackConfig, { paths }) => {
const releaseVersion = process.env.npm_package_version;
process.env.REACT_APP_SENTRY_RELEASE = releaseVersion;
if (process.env.SENTRY_RELEASE) {
webpackConfig.plugins.push(
new SentryCliPlugin({
url: 'https://sentry.projecterror.dev',
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'project-error',
project: 'npwd',
release: releaseVersion,
validate: true,
urlPrefix: '~/resources/html',
// webpack-specific configuration
include: ['../resources/html'],
ignore: ['node_modules'],
}),
);
}
const { hasFoundAny, matches } = getLoaders(webpackConfig, loaderByName('babel-loader'));
if (!hasFoundAny) throwError('failed to find babel-loader');