-
Notifications
You must be signed in to change notification settings - Fork 36
/
next.config.js
46 lines (40 loc) · 1.06 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
/** @type {import('next').NextConfig} */
const SentryPlugin = require('@sentry/webpack-plugin');
module.exports = {
reactStrictMode: true,
swcMinify: true,
trailingSlash: false,
// Sourcemaps are enabled to be uploaded to Sentry
// Warning: Can significantly increase build times
// and memory usage while being generated.
productionBrowserSourceMaps: true,
webpack: (config, { dev, isServer }) => {
// This uploads sourcemaps to Sentry
if (!dev && !isServer && !process.env.NODE_ENV === 'test') {
config.plugins.push(
new SentryPlugin({
release: process.env.RELEASE,
include: './out',
}),
);
}
config.module.rules.push({
test: /\.ya?ml$/,
type: 'json',
use: 'yaml-loader',
});
// Important: return the modified config
return config;
},
async redirects() {
return [
// The site does not have a home page
// This redirects to support docs
{
source: '/',
destination: '/docs/',
permanent: true,
},
];
},
};