-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathnext.config.js
88 lines (87 loc) · 1.97 KB
/
next.config.js
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
const path = require('path')
module.exports = {
// Configurable site features we support:
// distDir: 'build',
generateBuildId: () => 'build-id',
i18n: {
defaultLocale: 'en',
locales: ['en', 'es', 'fr'],
},
async headers() {
return [
{
source: '/',
headers: [
{
key: 'x-custom-header',
value: 'my custom header value',
},
],
},
{
source: '/api/:path*',
headers: [
{
key: 'x-custom-api-header',
value: 'my custom api header value',
},
],
},
{
source: '/:path*',
headers: [
{
key: 'x-custom-header-for-everything',
value: 'my custom header for everything value',
},
],
},
]
},
trailingSlash: true,
// Configurable site features _to_ support:
// basePath: '/docs',
// Rewrites allow you to map an incoming request path to a different destination path.
async rewrites() {
return {
beforeFiles: [
{
source: '/old/:path*',
destination: '/:path*',
},
],
afterFiles: [
{
source: '/rewriteToStatic',
destination: '/getStaticProps/1',
},
],
}
},
// Redirects allow you to redirect an incoming request path to a different destination path.
async redirects() {
return [
{
source: '/redirectme',
destination: '/',
permanent: true,
},
]
},
// https://nextjs.org/docs/basic-features/image-optimization#domains
images: {
domains: ['raw.githubusercontent.com', 'upload.wikimedia.org'],
remotePatterns: [
{
hostname: '*.imgur.com',
}
]
},
// https://nextjs.org/docs/basic-features/built-in-css-support#customizing-sass-options
sassOptions: {
includePaths: [path.join(__dirname, 'styles-sass-test')],
},
experimental: {
optimizeCss: false,
}
}