build: support sourcemap in sentry (#1910)

This commit is contained in:
Himself65 2023-04-12 21:26:06 -05:00 committed by GitHub
parent 1162bffb30
commit 2bcda973d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 1 deletions

View File

@ -20,4 +20,6 @@ ENABLE_CHANGELOG=1
# Sentry
SENTRY_AUTH_TOKEN=
SENTRY_ORG=
SENTRY_PROJECT=
NEXT_PUBLIC_SENTRY_DSN=

View File

@ -4,6 +4,7 @@ import path from 'node:path';
import { PerfseePlugin } from '@perfsee/webpack';
import { withSentryConfig } from '@sentry/nextjs';
import SentryWebpackPlugin from '@sentry/webpack-plugin';
import debugLocal from 'next-debug-local';
import preset from './preset.config.mjs';
@ -113,6 +114,19 @@ const nextConfig = {
config.plugins = [perfsee];
}
}
if (
process.env.SENTRY_AUTH_TOKEN &&
process.env.SENTRY_ORG &&
process.env.SENTRY_PROJECT
) {
config.plugins.push(
new SentryWebpackPlugin({
include: '.next',
ignore: ['node_modules', 'cypress', 'test'],
urlPrefix: '~/_next',
})
);
}
return config;
},

View File

@ -50,6 +50,7 @@
"@perfsee/webpack": "^1.5.0",
"@redux-devtools/extension": "^3.2.5",
"@rich-data/viewer": "^2.15.6",
"@sentry/webpack-plugin": "^1.20.0",
"@swc-jotai/debug-label": "^0.0.9",
"@swc-jotai/react-refresh": "^0.0.7",
"@types/react": "=18.0.31",

View File

@ -198,6 +198,7 @@ __metadata:
"@redux-devtools/extension": ^3.2.5
"@rich-data/viewer": ^2.15.6
"@sentry/nextjs": ^7.47.0
"@sentry/webpack-plugin": ^1.20.0
"@swc-jotai/debug-label": ^0.0.9
"@swc-jotai/react-refresh": ^0.0.7
"@toeverything/hooks": "workspace:*"
@ -4950,7 +4951,7 @@ __metadata:
languageName: node
linkType: hard
"@sentry/webpack-plugin@npm:1.20.0":
"@sentry/webpack-plugin@npm:1.20.0, @sentry/webpack-plugin@npm:^1.20.0":
version: 1.20.0
resolution: "@sentry/webpack-plugin@npm:1.20.0"
dependencies: