-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
115 lines (111 loc) · 3.09 KB
/
next.config.js
File metadata and controls
115 lines (111 loc) · 3.09 KB
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
105
106
107
108
109
110
111
112
113
114
115
const removeImports = require('next-remove-imports')()
const {withSentryConfig} = require('@sentry/nextjs')
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false, // strict mode creates error in VimeoPlayer - https://github.com/u-wave/react-vimeo/pull/175
swcMinify: true,
compiler: {
styledComponents: true,
emotion: true,
},
images: {
domains: [
'wp.streetofcode.sk',
'lh3.googleusercontent.com',
'process.env.WORDPRESS_API_URL.match(/(http(?:s)?:\\/\\/)(.*)/)[2]',
'avatars.githubusercontent.com',
'i.ytimg.com',
],
},
rewrites: () => {
return [
{
source: '/__/auth/handler',
destination: '/__/auth/handler.html',
},
{
source: '/__/auth/iframe',
destination: '/__/auth/iframe.html',
},
]
},
redirects: () => {
return [
{
source: '/blog/:slug*',
destination: '/clanky/:slug*',
permanent: true,
},
{
source: '/discord',
destination: 'https://discord.com/invite/PaFKszqU6J',
permanent: true,
},
{
source: '/patreon',
destination: 'https://www.patreon.com/streetofcode',
permanent: true,
},
{
source: '/facebook',
destination: 'https://www.facebook.com/streetofcode',
permanent: true,
},
{
source: '/instagram',
destination: 'https://www.instagram.com/streetofcode',
permanent: true,
},
{
source: '/twitter',
destination: 'https://twitter.com/StreetofCode1',
permanent: true,
},
{
source: '/youtube',
destination: 'https://www.youtube.com/@streetofcode',
permanent: true,
},
{
source: '/github',
destination: 'https://github.com/StreetOfCode',
permanent: true,
},
{
source: '/spotify',
destination:
'https://open.spotify.com/show/1nBhViArymuLrxuU4XkwRP?si=3w6MXuQ-SPKpffrsQd3rKg&nd=1',
permanent: true,
},
]
},
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,
net: false,
tls: false,
dns: false,
child_process: false,
}
return config
},
}
const sentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
hideSourceMaps: true,
silent: true, // Suppresses all logs
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
}
// We use removeImports because of MDEditor (in react-admin part)
// https://github.com/uiwjs/react-md-editor
module.exports = withSentryConfig(
removeImports(nextConfig),
sentryWebpackPluginOptions,
)