|
1 | 1 | import type { NextConfig } from 'next'; |
2 | 2 | import withBundleAnalyzer from '@next/bundle-analyzer'; |
| 3 | +import { withSentryConfig } from '@sentry/nextjs'; |
3 | 4 |
|
4 | 5 | const withAnalyzer = withBundleAnalyzer({ |
5 | 6 | enabled: process.env.ANALYZE === 'true', |
6 | 7 | }); |
7 | 8 |
|
8 | 9 | const nextConfig: NextConfig = { |
| 10 | + trailingSlash: true, |
9 | 11 | async headers() { |
10 | 12 | return [ |
11 | 13 | { |
12 | 14 | source: '/(.*)', |
13 | 15 | headers: [ |
14 | 16 | { |
15 | 17 | key: 'Content-Security-Policy', |
16 | | - value: "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; font-src 'self'; img-src 'self' https://img.shields.io https://goreportcard.com https://*.shields.io data:; connect-src 'self'; worker-src 'self' blob:", |
| 18 | + value: "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; font-src 'self'; img-src 'self' https://img.shields.io https://goreportcard.com https://*.shields.io data:; connect-src 'self' https://*.sentry.io; worker-src 'self' blob:", |
17 | 19 | }, |
18 | 20 | { |
19 | 21 | key: 'X-Frame-Options', |
@@ -48,4 +50,15 @@ const nextConfig: NextConfig = { |
48 | 50 | }, |
49 | 51 | }; |
50 | 52 |
|
51 | | -export default withAnalyzer(nextConfig); |
| 53 | +export default withSentryConfig( |
| 54 | + withAnalyzer(nextConfig), |
| 55 | + { |
| 56 | + org: process.env.SENTRY_ORG, |
| 57 | + project: process.env.SENTRY_PROJECT, |
| 58 | + authToken: process.env.SENTRY_AUTH_TOKEN, |
| 59 | + widenClientFileUpload: true, |
| 60 | + tunnelRoute: '/monitoring', |
| 61 | + silent: !process.env.CI, |
| 62 | + // Tree-shaking disabled — using Turbopack which doesn't support webpack tree-shaking |
| 63 | + } |
| 64 | +); |
0 commit comments