This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
70 lines (67 loc) · 1.76 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
const { withAxiom } = require('next-axiom')
const { withHighlightConfig } = require('@highlight-run/next')
const getStaticPages = require('./scripts/get-static-pages')
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config) => {
config.resolve.fallback = {
...config.resolve.fallback, // if you miss it, all the other options in fallback, specified
// by next.js will be dropped. Doesn't make much sense, but how it is
fs: false, // the solution
}
return config
},
compress: true,
images: {
domains: ['media.graphassets.com', 'lh3.googleusercontent.com', 'picsum.photos'],
},
productionBrowserSourceMaps: true,
reactStrictMode: true,
swcMinify: true,
env: {
staticPages: getStaticPages(),
},
async redirects() {
return [
{
source: '/docs',
destination: '/docs/general/welcome',
permanent: false,
},
{
source: '/docs/getting-started',
destination: '/docs/getting-started/overview',
permanent: false,
},
{
source: '/docs/general',
destination: '/docs/general/welcome',
permanent: false,
},
{
source: '/careers/:slug*',
destination: 'https://careers.highlight.io',
permanent: false,
},
{
source: '/community/:slug*',
destination: 'https://discord.com/invite/yxaXEAqgwN',
permanent: false,
},
{
source: '/github/:slug*',
destination: 'https://github.com/highlight/highlight',
permanent: false,
},
]
},
async rewrites() {
return [
{
source: '/sitemap.xml',
destination: '/api/sitemap',
},
]
},
}
module.exports = withHighlightConfig(withAxiom(nextConfig))