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
4 changed files with 19 additions and 1 deletions

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;
},