-
Notifications
You must be signed in to change notification settings - Fork 7
/
next.config.js
67 lines (62 loc) · 1.49 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
const withSourceMaps = require('@zeit/next-source-maps')();
const SentryWebpackPlugin = require('@sentry/webpack-plugin')
const { SENTRY_ORG, SENTRY_PROJECT, RELEASE, COMMIT_SHA } = process.env
module.exports = withSourceMaps({
async redirects() {
return [
{
source: '/company-information',
destination: '/faq',
permanent: true,
},
]
},
webpack: (config, { dev, isServer }) => {
const originalEntry = config.entry;
config.entry = async () => {
const entries = await originalEntry();
if (
entries['main.js'] &&
!entries['main.js'].includes('babel-polyfill')
) {
entries['main.js'].unshift('babel-polyfill');
}
return entries;
};
if (!isServer) {
config.resolve.alias['@sentry/node'] = '@sentry/browser'
}
if (SENTRY_ORG && SENTRY_PROJECT) {
config.plugins.push(
new SentryWebpackPlugin({
include: '.next',
ignore: ['node_modules'],
urlPrefix: '/app/.next',
release: RELEASE,
setCommits: {
repo: "itdagene-ntnu/itdagene-webapp",
commit: COMMIT_SHA
}
})
)
}
return config;
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'cdn.itdagene.no',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'itdagene.no',
port: '',
pathname: '/**',
},
],
},
swcMinify: true,
});