-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
next.config.mjs
86 lines (85 loc) · 1.98 KB
/
next.config.mjs
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
const nextConfig = {
// output: 'export',
trailingSlash: true, // use "/about/" instead of "/about" (not supported yet by --turbo)
poweredByHeader: false, // remove "Powered by Next.js" from the header
// transpilePackages: ['react-syntax-highlighter'],
experimental: {
scrollRestoration: true, // not supported yet by --turbo,
esmExternals: false
// serverActions: true
// esmExternals: 'loose' // https://nextjs.org/docs/messages/import-esm-externals
},
modularizeImports: {
lodash: {
transform: 'lodash/{{member}}',
preventFullImport: true
}
},
headers: async () => {
const headers = []
if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {
headers.push({
headers: [
{
key: 'X-Robots-Tag',
value: 'noindex'
}
],
source: '/:path*'
})
}
return headers
},
images: {
// unoptimized: true,
remotePatterns: [
{
protocol: 'https',
hostname: '**.gravatar.com'
},
{
protocol: 'https',
hostname: '**.math2it.com'
},
{
protocol: 'https',
hostname: '**.imgur.com'
},
{
protocol: 'https',
hostname: '**.dinhanhthi.com'
},
{
protocol: 'https',
hostname: '**.notion.so'
},
{
protocol: 'https',
hostname: '**.unsplash.com'
},
{
protocol: 'https',
hostname: '**.amazonaws.com'
},
{
protocol: 'https',
hostname: '**.cloudinary.com'
}
]
}
// redirects: async () => {
// return [
// // {
// // source: '/:slug',
// // destination: '/note/:slug',
// // permanent: true
// // }
// {
// source: '/:slug(^(?!notes$|tags$|about$|projects$|tools$|bookmarks$|support-me$).*)',
// destination: '/note/:slug',
// permanent: true
// }
// ]
// }
}
export default nextConfig