generated from r34son/next-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.ts
96 lines (94 loc) · 2.62 KB
/
next.config.ts
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import type { NextConfig } from 'next';
// @ts-expect-error no typings
import withPlugins from 'next-compose-plugins';
import withNextIntl from 'next-intl/plugin';
import withBundleAnalyzer from '@next/bundle-analyzer';
import { withSentryConfig } from '@sentry/nextjs';
const nextConfig: NextConfig = {
output: 'standalone',
assetPrefix: process.env.ASSET_PREFIX,
eslint: { ignoreDuringBuilds: true },
typescript: { ignoreBuildErrors: true },
serverExternalPackages: ['@sentry/profiling-node'],
devIndicators: {
appIsrStatus: true,
},
transpilePackages: ['next-csp'],
experimental: {
typedEnv: true,
reactCompiler: true,
preloadEntriesOnStart: true,
optimizePackageImports: [
'@floating-ui/core',
'@floating-ui/utils',
'@radix-ui/primitive',
'@radix-ui/react-popper',
'@radix-ui/react-compose-refs',
'@radix-ui/react-context',
'@radix-ui/react-id',
'@radix-ui/react-menu',
'@radix-ui/react-primitive',
'@radix-ui/react-use-controllable-state',
'@radix-ui/react-use-escape-keydown',
'@radix-ui/react-dismissable-layer',
'@radix-ui/react-dropdown-menu',
'@radix-ui/react-navigation-menu',
'@radix-ui/react-slot',
'@radix-ui/react-tooltip',
'tailwindcss',
],
},
headers: async () => [
{
source: '/:path*',
headers: [
{
key: 'X-DNS-Prefetch-Control',
value: 'on',
},
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Referrer-Policy',
value: 'origin-when-cross-origin',
},
{
key: 'Document-Policy',
value: 'js-profiling',
},
],
},
],
};
export default withPlugins(
[
withNextIntl(),
withBundleAnalyzer({ enabled: process.env.ANALYZE === 'true' }),
(nextConfig: NextConfig) =>
withSentryConfig(nextConfig, {
silent: true,
release: { create: false },
bundleSizeOptimizations: {
excludeDebugStatements: true,
excludeReplayShadowDom: true,
excludeReplayIframe: true,
},
// https://github.com/getsentry/sentry-javascript/issues/12645
// sourcemaps: {
// deleteSourcemapsAfterUpload: true,
// },
reactComponentAnnotation: { enabled: true },
widenClientFileUpload: true,
tunnelRoute: '/monitoring',
hideSourceMaps: true,
disableLogger: true,
}),
],
nextConfig,
);