forked from vtexdocs/devportal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
104 lines (101 loc) · 2.65 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/** @type {import('next').NextConfig} */
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { withPlaiceholder } = require('@plaiceholder/next')
const nextConfig = {
experimental: {
largePageDataBytes: 500 * 1000,
},
reactStrictMode: true,
staticPageGenerationTimeout: 3600,
images: {
remotePatterns: [
{
hostname: '**',
},
],
},
webpack: (config, options) => {
// this will override the experiments
config.experiments = { ...config.experiments, ...{ topLevelAwait: true } }
// this will just update topLevelAwait property of config.experiments
// config.experiments.topLevelAwait = true
config.module.rules.push({
test: /\.pem/,
use: [
options.defaultLoaders.babel,
{
loader: 'raw-loader',
},
],
})
return config
},
env: {
navigationJsonUrl: 'https://developers.vtex.com/navigation.json',
},
async redirects() {
return [
{
source: '/vtex-rest-api/docs/:slug',
destination: '/docs/guides/:slug',
permanent: true,
},
{
source: '/vtex-rest-api/docs',
destination: '/docs/guides',
permanent: true,
},
{
source: '/vtex-developer-docs/docs/:slug',
destination: '/docs/guides/:slug',
permanent: true,
},
{
source: '/vtex-developer-docs/docs',
destination: '/docs/guides',
permanent: true,
},
{
source: '/vtex-developer-docs/changelog/:slug',
destination: '/updates/release-notes/:slug',
permanent: true,
},
{
source: '/vtex-developer-docs/changelog',
destination: '/updates/release-notes',
permanent: true,
},
{
source: '/docs/api-guides/:slug*',
destination: '/docs/guides/:slug*',
permanent: true,
},
{
source: '/vtex-rest-api/reference/:slug*',
destination: '/docs/api-reference/:slug*',
permanent: true,
},
{
source: '/vtex-developer-docs/reference/:slug*',
destination: '/docs/api-reference/:slug*',
permanent: true,
},
{
source: '/vtex-rest-api/reference',
destination: '/docs/api-reference',
permanent: true,
},
{
source: '/vtex-developer-docs/reference',
destination: '/docs/api-reference',
permanent: true,
},
{
source: '/docs/erp-integration-set-up-order-processing',
destination: '/docs/guides/erp-integration-set-up-order-processing',
permanent: true,
},
]
},
}
module.exports = withPlaiceholder(nextConfig)