Skip to content

Commit

Permalink
Bumpet sentry/webpack-plugin til 2.14.1 (#1091)
Browse files Browse the repository at this point in the history
* Bumpet sentry/webpack-plugin til 2.14.1

* Tester å kaste feil i dev

* Enabler sentry for alle envs midlertidig

* Prøver å fjerne sourcemap config fra sentryWebpackPlugin

* Justert webpack.production.config.ts

* Lagt til release og uploadLegacySourcemaps i sentryWebpackplugin config

* Forsøker å bruke sourcemaps option fremfor legacy

* Bruker base path i sourcemaps.assets

* Bruker updatedLegacySourcemaps fordi vi kjører på Sentry versjon < 23.6.1

* Reverterer endringer relatert til testing
  • Loading branch information
bragejahren authored Feb 22, 2024
1 parent d1bc2ca commit a561fd2
Show file tree
Hide file tree
Showing 3 changed files with 330 additions and 96 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"@navikt/familie-typer": "^8.0.0",
"@navikt/fnrvalidator": "^1.3.3",
"@navikt/nav-dekoratoren-moduler": "^1.6.4",
"@sentry/react": "^7.93.0",
"@sentry/react": "^7.101.1",
"amplitude-js": "^8.21.9",
"axios": "^1.6.2",
"compression": "^1.7.4",
Expand Down Expand Up @@ -142,7 +142,7 @@
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@sentry/webpack-plugin": "^1.20.1",
"@sentry/webpack-plugin": "^2.14.1",
"@testing-library/dom": "^9.3.3",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
Expand Down
20 changes: 11 additions & 9 deletions src/webpack/webpack.production.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SentryCliPlugin from '@sentry/webpack-plugin';
import { sentryWebpackPlugin } from '@sentry/webpack-plugin';
import CssMinimizerWebpackPlugin from 'css-minimizer-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import TerserWebpackPlugin from 'terser-webpack-plugin';
Expand All @@ -23,18 +23,20 @@ const prodConfig: webpack.Configuration = mergeWithRules({
}),
new CssMinimizerWebpackPlugin(),
process.env.SENTRY_AUTH_TOKEN
? new SentryCliPlugin({
include: 'dist',
? sentryWebpackPlugin({
org: 'nav',
project: 'familie-ba-soknad',
authToken: process.env.SENTRY_AUTH_TOKEN,
url: 'https://sentry.gc.nav.no/',
release: process.env.SENTRY_RELEASE,
urlPrefix: `~${process.env.BASE_PATH}`,
errorHandler: (err, _, compilation) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
compilation.warnings.push('Sentry CLI Plugin: ' + err.message);
release: {
name: process.env.SENTRY_RELEASE,
uploadLegacySourcemaps: {
paths: ['dist'],
urlPrefix: `~${process.env.BASE_PATH}`,
},
},
errorHandler: err => {
console.warn('Sentry CLI Plugin: ' + err.message);
},
})
: undefined,
Expand Down
Loading

0 comments on commit a561fd2

Please sign in to comment.