mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-18 18:41:52 +08:00
build: support sourcemap in sentry (#1910)
This commit is contained in:
@@ -20,4 +20,6 @@ ENABLE_CHANGELOG=1
|
|||||||
|
|
||||||
# Sentry
|
# Sentry
|
||||||
SENTRY_AUTH_TOKEN=
|
SENTRY_AUTH_TOKEN=
|
||||||
|
SENTRY_ORG=
|
||||||
|
SENTRY_PROJECT=
|
||||||
NEXT_PUBLIC_SENTRY_DSN=
|
NEXT_PUBLIC_SENTRY_DSN=
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import path from 'node:path';
|
|||||||
|
|
||||||
import { PerfseePlugin } from '@perfsee/webpack';
|
import { PerfseePlugin } from '@perfsee/webpack';
|
||||||
import { withSentryConfig } from '@sentry/nextjs';
|
import { withSentryConfig } from '@sentry/nextjs';
|
||||||
|
import SentryWebpackPlugin from '@sentry/webpack-plugin';
|
||||||
import debugLocal from 'next-debug-local';
|
import debugLocal from 'next-debug-local';
|
||||||
|
|
||||||
import preset from './preset.config.mjs';
|
import preset from './preset.config.mjs';
|
||||||
@@ -113,6 +114,19 @@ const nextConfig = {
|
|||||||
config.plugins = [perfsee];
|
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;
|
return config;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
"@perfsee/webpack": "^1.5.0",
|
"@perfsee/webpack": "^1.5.0",
|
||||||
"@redux-devtools/extension": "^3.2.5",
|
"@redux-devtools/extension": "^3.2.5",
|
||||||
"@rich-data/viewer": "^2.15.6",
|
"@rich-data/viewer": "^2.15.6",
|
||||||
|
"@sentry/webpack-plugin": "^1.20.0",
|
||||||
"@swc-jotai/debug-label": "^0.0.9",
|
"@swc-jotai/debug-label": "^0.0.9",
|
||||||
"@swc-jotai/react-refresh": "^0.0.7",
|
"@swc-jotai/react-refresh": "^0.0.7",
|
||||||
"@types/react": "=18.0.31",
|
"@types/react": "=18.0.31",
|
||||||
|
|||||||
@@ -198,6 +198,7 @@ __metadata:
|
|||||||
"@redux-devtools/extension": ^3.2.5
|
"@redux-devtools/extension": ^3.2.5
|
||||||
"@rich-data/viewer": ^2.15.6
|
"@rich-data/viewer": ^2.15.6
|
||||||
"@sentry/nextjs": ^7.47.0
|
"@sentry/nextjs": ^7.47.0
|
||||||
|
"@sentry/webpack-plugin": ^1.20.0
|
||||||
"@swc-jotai/debug-label": ^0.0.9
|
"@swc-jotai/debug-label": ^0.0.9
|
||||||
"@swc-jotai/react-refresh": ^0.0.7
|
"@swc-jotai/react-refresh": ^0.0.7
|
||||||
"@toeverything/hooks": "workspace:*"
|
"@toeverything/hooks": "workspace:*"
|
||||||
@@ -4950,7 +4951,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
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
|
version: 1.20.0
|
||||||
resolution: "@sentry/webpack-plugin@npm:1.20.0"
|
resolution: "@sentry/webpack-plugin@npm:1.20.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|||||||
Reference in New Issue
Block a user