-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
next.config.ts
89 lines (85 loc) · 1.75 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
import bundleAnalyzer from '@next/bundle-analyzer'
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
reactStrictMode: true,
experimental: {
turbo: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
},
},
nextScriptWorkers: true,
reactCompiler: true,
},
devIndicators: {
appIsrStatus: false,
},
typescript: {
ignoreBuildErrors: true,
},
images: {
dangerouslyAllowSVG: true,
remotePatterns: [
{
protocol: 'https',
hostname: 'cdn.shopify.com',
},
{
protocol: 'https',
hostname: 'a-us.storyblok.com',
},
{
protocol: 'https',
hostname: 'assets.darkroom.engineering',
},
],
formats: ['image/avif', 'image/webp'],
},
headers: async () => [
{
source: '/(.*)',
headers: [
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Content-Security-Policy',
value: "frame-ancestors 'self' https://app.storyblok.com/",
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN',
},
{
key: 'X-XSS-Protection',
value: '1; mode=block',
},
],
},
],
redirects: async () => [
{
source: '/home',
destination: '/',
permanent: true,
},
],
rewrites: async () => [
{
source: '/',
destination: '/home',
},
],
}
const bundleAnalyzerPlugin = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
})
const NextApp = () => {
const plugins = [bundleAnalyzerPlugin]
return plugins.reduce((config, plugin) => plugin(config), nextConfig)
}
export default NextApp