-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
51 lines (40 loc) · 1.11 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
const path = require('path');
const withPWA = require('next-pwa')({ dest: 'public' });
const { withSentryConfig } = require('@sentry/nextjs');
/**
* Next.js configuration
*/
/** @type {import('next').NextConfig} */
let config = {
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
},
publicRuntimeConfig: {
BASE_ADDRESS: process.env.BASE_ADDRESS ?? "http://localhost:3000",
},
serverRuntimeConfig: {
MONGODB_HOSTNAME: process.env.MONGODB_HOSTNAME ?? "localhost",
MONGODB_DATABASE: process.env.MONGODB_DATABASE ?? "surt",
MONGODB_USERNAME: process.env.MONGODB_USERNAME ?? "surt",
MONGODB_PASSWORD: process.env.MONGODB_PASSWORD ?? "surt",
}
};
/**
* PWA configuration with next-pwa
*/
config = withPWA(config);
/**
* Sentry.io integration
*/
const useSentry = process.env.SENTRY_AUTH_TOKEN !== undefined;
const sentryWebpackOptions = {
silent: true,
};
const sentryOptions = {
hideSourceMaps: false
};
if(useSentry) {
console.log("[SURT] Sentry monitoring enabled.");
config = withSentryConfig(config, sentryWebpackOptions, sentryOptions);
}
module.exports = config;