-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathnext.config.ts
More file actions
81 lines (78 loc) · 3.05 KB
/
next.config.ts
File metadata and controls
81 lines (78 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import type { NextConfig } from 'next';
import withBundleAnalyzer from '@next/bundle-analyzer';
import { withSentryConfig } from '@sentry/nextjs';
const withAnalyzer = withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});
const nextConfig: NextConfig = {
trailingSlash: true,
async headers() {
return [
{
source: '/wasm/:path*',
headers: [
{
key: 'Cache-Control',
value: 'public, max-age=31536000, immutable',
},
],
},
{
source: '/(.*)',
headers: [
{
key: 'Content-Security-Policy',
value: "default-src 'self'; script-src 'self' 'unsafe-inline' '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 https://vitals.vercel-insights.com; worker-src 'self' blob:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'",
},
{
key: 'Strict-Transport-Security',
value: 'max-age=31536000; includeSubDomains; preload',
},
{
key: 'Permissions-Policy',
value: 'camera=(), microphone=(), geolocation=(), interest-cohort=()',
},
{
key: 'X-Frame-Options',
value: 'DENY',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin',
},
],
},
];
},
async redirects() {
return [
{ source: '/docs/getting_started', destination: '/docs/getting-started', permanent: true },
{ source: '/docs/usage_guide', destination: '/docs/usage-guide', permanent: true },
{ source: '/docs/api_reference', destination: '/docs/api-reference', permanent: true },
{ source: '/docs/cli_guide', destination: '/docs/cli-guide', permanent: true },
{ source: '/docs/error_codes', destination: '/docs/error-codes', permanent: true },
{ source: '/docs/sql_compatibility', destination: '/docs/sql-compatibility', permanent: true },
{ source: '/docs/linting_rules', destination: '/docs/linting-rules', permanent: true },
{ source: '/docs/lsp_guide', destination: '/docs/lsp-guide', permanent: true },
{ source: '/docs/mcp_guide', destination: '/docs/mcp-guide', permanent: true },
{ source: '/docs/production_guide', destination: '/docs/production-guide', permanent: true },
{ source: '/docs/performance_tuning', destination: '/docs/performance-tuning', permanent: true },
];
},
};
export default withSentryConfig(
withAnalyzer(nextConfig),
{
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
widenClientFileUpload: true,
tunnelRoute: '/monitoring',
silent: !process.env.CI,
// Tree-shaking disabled — using Turbopack which doesn't support webpack tree-shaking
}
);