-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
77 lines (70 loc) 路 1.66 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
/* eslint-disable @typescript-eslint/no-var-requires */
const withPlugins = require('next-compose-plugins')
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
options: {
remarkPlugins: [
require('remark-slug'),
require('remark-code-titles'),
require('remark-toc'),
require('remark-external-links'),
],
rehypePlugins: [require('rehype-autolink-headings')],
},
})
const plugins = [withMDX]
const nextConfig = {
async redirects() {
return [
{
source: '/metrics',
destination: 'https://metrics.tundera.dev',
permanent: true,
},
]
},
reactStrictMode: true,
future: {
webpack5: true,
},
experimental: {
reactMode: 'concurrent',
},
target: 'experimental-serverless-trace',
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'],
i18n: {
defaultLocale: 'en',
locales: ['en', 'de'],
},
images: {
domains: [
'media.graphcms.com', // GraphCMS content
'files.stripe.com', // Stripe images
'upload.wikimedia.org', // Wikipedia images
'i.scdn.co', // Spotify now playing
'pbs.twimg.com', // Twitter profile
],
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback = {
fs: false,
module: false,
}
}
config.module.rules.push({
test: /\.(graphql|gql)$/,
exclude: /node_modules/,
loader: 'graphql-tag/loader',
})
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
})
return config
},
webpackDevMiddleware: (config) => {
return config
},
}
module.exports = withPlugins([...plugins], nextConfig)